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:
parent
51a1b6d84c
commit
b6d7f36a7d
1 changed files with 7 additions and 1 deletions
8
magit.el
8
magit.el
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue