aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-06-07 12:50:52 +0100
committerSean Whitton2025-06-07 13:27:00 +0100
commit82109aa7261ef98f41201b775f92d50ab7a4e6bb (patch)
treefcbb6d67a3c37e90dda2886e22db3a31dee1da24
parent58797a67358754249d594f5f113b59031ca82e64 (diff)
downloademacs-82109aa7261ef98f41201b775f92d50ab7a4e6bb.tar.gz
emacs-82109aa7261ef98f41201b775f92d50ab7a4e6bb.zip
Inline sole call to vc-git--state-code
* lisp/vc/vc-git.el (vc-git--state-code): Delete. (vc-git-after-dir-status-stage): Inline it here.
-rw-r--r--lisp/vc/vc-git.el19
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index bea1a2a282a..ba72a3f0db5 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -314,15 +314,6 @@ Good example of file name that needs this: \"test[56].xx\".")
314 (string= (substring str 0 (1+ (length name))) 314 (string= (substring str 0 (1+ (length name)))
315 (concat name "\0")))))))) 315 (concat name "\0"))))))))
316 316
317(defun vc-git--state-code (code)
318 "Convert from a string to an added/deleted/modified state."
319 (pcase (string-to-char code)
320 (?M 'edited)
321 (?A 'added)
322 (?D 'removed)
323 (?U 'edited) ;; FIXME
324 (?T 'edited))) ;; FIXME
325
326(defvar vc-git--program-version nil) 317(defvar vc-git--program-version nil)
327 318
328(connection-local-set-profile-variables 319(connection-local-set-profile-variables
@@ -657,7 +648,7 @@ or an empty string if none."
657 (state (or (match-string 4) (match-string 6))) 648 (state (or (match-string 4) (match-string 6)))
658 (name (or (match-string 5) (match-string 7))) 649 (name (or (match-string 5) (match-string 7)))
659 (new-name (match-string 8))) 650 (new-name (match-string 8)))
660 (if new-name ; Copy or rename. 651 (if new-name ; Copy or rename.
661 (if (eq ?C (string-to-char state)) 652 (if (eq ?C (string-to-char state))
662 (vc-git-dir-status-update-file 653 (vc-git-dir-status-update-file
663 git-state new-name 'added 654 git-state new-name 'added
@@ -671,7 +662,13 @@ or an empty string if none."
671 (vc-git-create-extra-fileinfo old-perm new-perm 662 (vc-git-create-extra-fileinfo old-perm new-perm
672 'rename name))) 663 'rename name)))
673 (vc-git-dir-status-update-file 664 (vc-git-dir-status-update-file
674 git-state name (vc-git--state-code state) 665 git-state name (pcase (string-to-char state)
666 (?M 'edited)
667 (?A 'added)
668 (?C 'added)
669 (?D 'removed)
670 (?U 'edited) ;; FIXME
671 (?T 'edited)) ;; FIXME
675 (vc-git-create-extra-fileinfo old-perm new-perm))))))) 672 (vc-git-create-extra-fileinfo old-perm new-perm)))))))
676 ;; If we had files but now we don't, it's time to stop. 673 ;; If we had files but now we don't, it's time to stop.
677 (when (and files (not (vc-git-dir-status-state->files git-state))) 674 (when (and files (not (vc-git-dir-status-state->files git-state)))