aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc/vc-git.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r--lisp/vc/vc-git.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 5c21a5b884e..9ec45c59893 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -416,15 +416,18 @@ in the order given by `git status'."
416 416
417(defun vc-git-mode-line-string (file) 417(defun vc-git-mode-line-string (file)
418 "Return a string for `vc-mode-line' to put in the mode line for FILE." 418 "Return a string for `vc-mode-line' to put in the mode line for FILE."
419 (let* ((rev (vc-working-revision file 'Git)) 419 (pcase-let* ((backend-name "Git")
420 (disp-rev (or (vc-git--symbolic-ref file) 420 (state (vc-state file))
421 (and rev (substring rev 0 7)))) 421 (`(,state-echo ,face ,indicator)
422 (def-ml (vc-default-mode-line-string 'Git file)) 422 (vc-mode-line-state state))
423 (help-echo (get-text-property 0 'help-echo def-ml)) 423 (rev (vc-working-revision file 'Git))
424 (face (get-text-property 0 'face def-ml))) 424 (disp-rev (or (vc-git--symbolic-ref file)
425 (propertize (concat (substring def-ml 0 4) disp-rev) 425 (and rev (substring rev 0 7))))
426 'face face 426 (state-string (concat backend-name indicator disp-rev)))
427 'help-echo (concat help-echo "\nCurrent revision: " rev)))) 427 (propertize state-string 'face face 'help-echo
428 (concat state-echo " under the " backend-name
429 " version control system"
430 "\nCurrent revision: " rev))))
428 431
429(cl-defstruct (vc-git-extra-fileinfo 432(cl-defstruct (vc-git-extra-fileinfo
430 (:copier nil) 433 (:copier nil)