Make magit-name-rev a little cleaner.

The main thing is using --no-undefined to eliminate an extra check.
This commit is contained in:
Nathan Weizenbaum 2010-06-16 23:55:51 -07:00
parent 5744d3ec98
commit c337dcc07c

View file

@ -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)