Prefer symbolic names for default revisions.

* magit.el (magit-name-rev): Do nothing when given nil.
(magit-default-rev): Pass commit thru magit-name-rev.
This commit is contained in:
Marius Vollmer 2008-09-15 02:41:20 +03:00
parent 7853395831
commit 87a437fab9

View file

@ -199,7 +199,8 @@ Many Magit faces inherit from this one by default."
dir)))
(defun magit-name-rev (rev)
(magit-shell "git name-rev --always --name-only %s" rev))
(and rev
(magit-shell "git name-rev --always --name-only %s" rev)))
(defun magit-put-line-property (prop val)
(put-text-property (line-beginning-position) (line-beginning-position 2)
@ -307,7 +308,7 @@ Many Magit faces inherit from this one by default."
(format "%s at %s" things (magit-rev-describe (car range))))))
(defun magit-default-rev ()
(magit-commit-at-point t))
(magit-name-rev (magit-commit-at-point t)))
;;; Sections