emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 87ee542: (vc-git-mode-line-string): Don't use `re


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 87ee542: (vc-git-mode-line-string): Don't use `replace-regexp-in-string'
Date: Sat, 23 Apr 2016 19:16:55 +0000

branch: emacs-25
commit 87ee542fbc93e172d10fb742a15b2a9fdc526992
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    (vc-git-mode-line-string): Don't use `replace-regexp-in-string'
    
    * lisp/vc/vc-git.el (vc-git-mode-line-string): Use `substring'
    instead of `replace-regexp-in-string', because REV can be nil
    (e.g. when FILE is a directory, bug#23344), and we actually know
    we only need the first 4 characters.
---
 lisp/vc/vc-git.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index f8b0b6f..5d06bf7 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -284,7 +284,7 @@ Should be consistent with the Git config value 
i18n.logOutputEncoding."
          (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))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]