Make magit-name-rev a little cleaner.
The main thing is using --no-undefined to eliminate an extra check.
This commit is contained in:
parent
5744d3ec98
commit
c337dcc07c
1 changed files with 3 additions and 5 deletions
8
magit.el
8
magit.el
|
@ -509,11 +509,9 @@ return nil."
|
||||||
default-directory)))))
|
default-directory)))))
|
||||||
|
|
||||||
(defun magit-name-rev (rev)
|
(defun magit-name-rev (rev)
|
||||||
(and rev
|
(when rev
|
||||||
(let ((name (magit-git-string "name-rev" "--name-only" rev)))
|
(let ((name (magit-git-string "name-rev" "--no-undefined" "--name-only" rev)))
|
||||||
(if (or (not name) (string= name "undefined"))
|
(or name rev))))
|
||||||
rev
|
|
||||||
name))))
|
|
||||||
|
|
||||||
(defun magit-put-line-property (prop val)
|
(defun magit-put-line-property (prop val)
|
||||||
(put-text-property (line-beginning-position) (line-beginning-position 2)
|
(put-text-property (line-beginning-position) (line-beginning-position 2)
|
||||||
|
|
Loading…
Add table
Reference in a new issue