diff options
| author | Sean Whitton | 2025-12-13 14:13:15 +0000 |
|---|---|---|
| committer | Sean Whitton | 2025-12-13 14:13:15 +0000 |
| commit | 2d96fdc3b7dc63744fe8c4a1a76c10d09d2b2aee (patch) | |
| tree | 10cdde53dc8e6f79ce1903c1461a76e2f0e7d128 | |
| parent | b7f2ccac1e6fbb8615431f96dd94128b27146985 (diff) | |
| download | emacs-2d96fdc3b7dc63744fe8c4a1a76c10d09d2b2aee.tar.gz emacs-2d96fdc3b7dc63744fe8c4a1a76c10d09d2b2aee.zip | |
vc-git-dir-status-goto-stage: Accept exit 128 from git-add
* lisp/vc/vc-git.el (vc-git-dir-status-goto-stage): Accept an
exit code of 128 from 'git add --refresh' (bug#79999).
| -rw-r--r-- | lisp/vc/vc-git.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ad70202724e..0bcd0bcf1e4 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -718,12 +718,17 @@ or an empty string if none." | |||
| 718 | 718 | ||
| 719 | (defun vc-git-dir-status-goto-stage (git-state) | 719 | (defun vc-git-dir-status-goto-stage (git-state) |
| 720 | ;; TODO: Look into reimplementing this using `git status --porcelain=v2'. | 720 | ;; TODO: Look into reimplementing this using `git status --porcelain=v2'. |
| 721 | (let ((files (vc-git-dir-status-state->files git-state))) | 721 | (let ((files (vc-git-dir-status-state->files git-state)) |
| 722 | (allowed-exit 1)) | ||
| 722 | (erase-buffer) | 723 | (erase-buffer) |
| 723 | (pcase (vc-git-dir-status-state->stage git-state) | 724 | (pcase (vc-git-dir-status-state->stage git-state) |
| 724 | ('update-index | 725 | ('update-index |
| 725 | (if files | 726 | (if files |
| 726 | (vc-git-command (current-buffer) 'async files "add" "--refresh" "--") | 727 | (progn (vc-git-command (current-buffer) 'async files |
| 728 | "add" "--refresh" "--") | ||
| 729 | ;; git-add exits 128 if some of FILES are untracked; | ||
| 730 | ;; we can ignore that (bug#79999). | ||
| 731 | (setq allowed-exit 128)) | ||
| 727 | (vc-git-command (current-buffer) 'async nil | 732 | (vc-git-command (current-buffer) 'async nil |
| 728 | "update-index" "--refresh"))) | 733 | "update-index" "--refresh"))) |
| 729 | ('ls-files-added | 734 | ('ls-files-added |
| @@ -749,7 +754,7 @@ or an empty string if none." | |||
| 749 | ('diff-index | 754 | ('diff-index |
| 750 | (vc-git-command (current-buffer) 'async files | 755 | (vc-git-command (current-buffer) 'async files |
| 751 | "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) | 756 | "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) |
| 752 | (vc-run-delayed-success 1 | 757 | (vc-run-delayed-success allowed-exit |
| 753 | (vc-git-after-dir-status-stage git-state)))) | 758 | (vc-git-after-dir-status-stage git-state)))) |
| 754 | 759 | ||
| 755 | (defun vc-git-dir-status-files (_dir files update-function) | 760 | (defun vc-git-dir-status-files (_dir files update-function) |