Handle revs that don't have a name.

* magit.el (magit-name-rev): Return original rev if name-rev returns
"undefined".  Shouldn't happen, but does.  Bug in git?
This commit is contained in:
Marius Vollmer 2008-09-26 16:10:17 +03:00
parent e5b55cbce0
commit d48fd13d27

View file

@ -200,7 +200,10 @@ Many Magit faces inherit from this one by default."
(defun magit-name-rev (rev)
(and rev
(magit-shell "git name-rev --always --name-only %s" rev)))
(let ((name (magit-shell "git name-rev --always --name-only %s" rev)))
(if (or (not name) (string= name "undefined"))
rev
name))))
(defun magit-put-line-property (prop val)
(put-text-property (line-beginning-position) (line-beginning-position 2)