aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2016-04-27 13:18:04 +0800
committerLeo Liu2016-04-27 13:18:16 +0800
commite55d0db95700edd11e71660729566c67b6c563b3 (patch)
treed3181c47dceb97a17da0425703c934cccf9f7e48
parentca87b349af02cf6761da576ae892d77d167d863e (diff)
downloademacs-e55d0db95700edd11e71660729566c67b6c563b3.tar.gz
emacs-e55d0db95700edd11e71660729566c67b6c563b3.zip
Fix revision calculation in vc-git-mode-line-string
* 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.
-rw-r--r--lisp/vc/vc-git.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 5d06bf7f357..d5ba0c8be7d 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -278,7 +278,7 @@ Should be consistent with the Git config value i18n.logOutputEncoding."
278 278
279(defun vc-git-mode-line-string (file) 279(defun vc-git-mode-line-string (file)
280 "Return a string for `vc-mode-line' to put in the mode line for FILE." 280 "Return a string for `vc-mode-line' to put in the mode line for FILE."
281 (let* ((rev (vc-working-revision file)) 281 (let* ((rev (vc-git-working-revision file))
282 (disp-rev (or (vc-git--symbolic-ref file) 282 (disp-rev (or (vc-git--symbolic-ref file)
283 (substring rev 0 7))) 283 (substring rev 0 7)))
284 (def-ml (vc-default-mode-line-string 'Git file)) 284 (def-ml (vc-default-mode-line-string 'Git file))