When there is a guessed branch, it make a good default rev.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
This commit is contained in:
Rémi Vanicat 2010-04-10 21:17:27 +02:00 committed by Phil Jackson
parent 51a1b6d84c
commit b6d7f36a7d

View file

@ -591,7 +591,13 @@ Many Magit faces inherit from this one by default."
(format "%s at %s" things (magit-rev-describe (car range))))))
(defun magit-default-rev ()
(magit-name-rev (magit-commit-at-point t)))
(or (magit-name-rev (magit-commit-at-point t))
(let ((branch (magit-guess-branch)))
(if branch
(if (string-match "^refs/\\(.*\\)" branch)
(match-string 1 branch)
branch)))))
;;; Sections