]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/vc-git.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / vc / vc-git.el
index 2fd84f102f8fdbfb4c67b10ddfd89caab0ddda5a..16cbeef57eabbe9ba687e0f8e1421b4bd4a409fa 100644 (file)
@@ -278,13 +278,13 @@ Should be consistent with the Git config value i18n.logOutputEncoding."
 
 (defun vc-git-mode-line-string (file)
   "Return a string for `vc-mode-line' to put in the mode line for FILE."
-  (let* ((rev (vc-working-revision file))
+  (let* ((rev (vc-working-revision file 'Git))
          (disp-rev (or (vc-git--symbolic-ref file)
                        (substring rev 0 7)))
          (def-ml (vc-default-mode-line-string 'Git file))
          (help-echo (get-text-property 0 'help-echo def-ml))
          (face   (get-text-property 0 'face def-ml)))
-    (propertize (replace-regexp-in-string (concat rev "\\'") disp-rev def-ml t t)
+    (propertize (concat (substring def-ml 0 4) disp-rev)
                 'face face
                 'help-echo (concat help-echo "\nCurrent revision: " rev))))