diff options
| author | Dmitry Gutov | 2016-04-23 22:16:27 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2016-04-23 22:16:40 +0300 |
| commit | 87ee542fbc93e172d10fb742a15b2a9fdc526992 (patch) | |
| tree | edd2dab368d65830376b630f798c23d841cf183c | |
| parent | 5c587fdff164e8b90beb47f6da64b4884290e40a (diff) | |
| download | emacs-87ee542fbc93e172d10fb742a15b2a9fdc526992.tar.gz emacs-87ee542fbc93e172d10fb742a15b2a9fdc526992.zip | |
(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.
| -rw-r--r-- | lisp/vc/vc-git.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f8b0b6fcd54..5d06bf7f357 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." | |||
| 284 | (def-ml (vc-default-mode-line-string 'Git file)) | 284 | (def-ml (vc-default-mode-line-string 'Git file)) |
| 285 | (help-echo (get-text-property 0 'help-echo def-ml)) | 285 | (help-echo (get-text-property 0 'help-echo def-ml)) |
| 286 | (face (get-text-property 0 'face def-ml))) | 286 | (face (get-text-property 0 'face def-ml))) |
| 287 | (propertize (replace-regexp-in-string (concat rev "\\'") disp-rev def-ml t t) | 287 | (propertize (concat (substring def-ml 0 4) disp-rev) |
| 288 | 'face face | 288 | 'face face |
| 289 | 'help-echo (concat help-echo "\nCurrent revision: " rev)))) | 289 | 'help-echo (concat help-echo "\nCurrent revision: " rev)))) |
| 290 | 290 | ||