]> code.delx.au - gnu-emacs/commitdiff
Fix revision calculation in vc-git-mode-line-string
authorLeo Liu <sdl.web@gmail.com>
Wed, 27 Apr 2016 05:18:04 +0000 (13:18 +0800)
committerLeo Liu <sdl.web@gmail.com>
Wed, 27 Apr 2016 05:18:16 +0000 (13:18 +0800)
* lisp/vc/vc-git.el (vc-git-mode-line-string): Use
  vc-git-working-revision because vc-working-revision needs to decide
  the backend and may return nil.

lisp/vc/vc-git.el

index 5d06bf7f3572c18003fff47a412750215834b8dd..d5ba0c8be7d910aa90b639a88bea77191654e563 100644 (file)
@@ -278,7 +278,7 @@ 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-git-working-revision file))
          (disp-rev (or (vc-git--symbolic-ref file)
                        (substring rev 0 7)))
          (def-ml (vc-default-mode-line-string 'Git file))