aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2019-12-16 23:55:11 +0200
committerDmitry Gutov2019-12-17 01:50:09 +0200
commit77fe255d90c74a43aa46c475a34a5a4055f7a4b6 (patch)
treec2e322b8a94b0f54009dd2b28316f7783bf8d9ba
parent1e240a0ecdcf0eb4653ba57f8daa138ba2a2aab6 (diff)
downloademacs-77fe255d90c74a43aa46c475a34a5a4055f7a4b6.tar.gz
emacs-77fe255d90c74a43aa46c475a34a5a4055f7a4b6.zip
vc-git-after-dir-status-stage: Avoid erroneous up-to-date status
* lisp/vc/vc-git.el (vc-git-after-dir-status-stage): Don't set `up-to-date' status if the previous stage (`diff-index') has assigned some other status to the file (bug#38615).
-rw-r--r--lisp/vc/vc-git.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 71307cdffda..021b48a5d1e 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -521,14 +521,19 @@ or an empty string if none."
521 ('ls-files-up-to-date 521 ('ls-files-up-to-date
522 (setq next-stage 'ls-files-unknown) 522 (setq next-stage 'ls-files-unknown)
523 (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} \\([0-3]\\)\t\\([^\0]+\\)\0" nil t) 523 (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} \\([0-3]\\)\t\\([^\0]+\\)\0" nil t)
524 (let ((perm (string-to-number (match-string 1) 8)) 524 (let* ((perm (string-to-number (match-string 1) 8))
525 (state (match-string 2)) 525 (state (match-string 2))
526 (name (match-string 3))) 526 (name (match-string 3))
527 (vc-git-dir-status-update-file 527 (file-info (vc-git-create-extra-fileinfo perm perm)))
528 git-state name (if (equal state "0") 528 (if (equal state "0")
529 'up-to-date 529 (unless (gethash name (vc-git-dir-status-state->hash git-state))
530 'conflict) 530 ;; `diff-index' stage has not produced a more precise info.
531 (vc-git-create-extra-fileinfo perm perm))))) 531 (vc-git-dir-status-update-file
532 git-state name 'up-to-date file-info))
533 ;; `diff-index' assigns `edited' status to conflicted
534 ;; files, so we can't do the above in both cases.
535 (vc-git-dir-status-update-file
536 git-state name 'conflict file-info)))))
532 ('ls-files-conflict 537 ('ls-files-conflict
533 (setq next-stage 'ls-files-unknown) 538 (setq next-stage 'ls-files-unknown)
534 ;; It's enough to look for "3" to notice a conflict. 539 ;; It's enough to look for "3" to notice a conflict.