Show branch name in "Remote:" section when tracking local branch
When the current branch is tracking a local branch (the remote is ".") show the local upstream branch in the "Remote:" section.
This commit is contained in:
parent
04984e5265
commit
b65979510e
1 changed files with 9 additions and 5 deletions
14
magit.el
14
magit.el
|
@ -2474,10 +2474,14 @@ insert a line to tell how to insert more of them"
|
|||
|
||||
;;; Status
|
||||
|
||||
(defun magit-remote-string (remote svn-info)
|
||||
(if remote
|
||||
(concat remote " " (magit-get "remote" remote "url"))
|
||||
(when svn-info
|
||||
(defun magit-remote-string (remote remote-branch svn-info)
|
||||
(cond
|
||||
((string= "." remote)
|
||||
(format "branch %s"
|
||||
(propertize remote-branch 'face 'magit-branch)))
|
||||
(remote
|
||||
(concat remote " " (magit-get "remote" remote "url")))
|
||||
(svn-info
|
||||
(concat (cdr (assoc 'url svn-info))
|
||||
" @ "
|
||||
(cdr (assoc 'revision svn-info))))))
|
||||
|
@ -2489,7 +2493,7 @@ insert a line to tell how to insert more of them"
|
|||
(remote (and branch (magit-get "branch" branch "remote")))
|
||||
(remote-branch (or (and branch (magit-remote-branch-for branch)) branch))
|
||||
(svn-info (magit-get-svn-ref-info))
|
||||
(remote-string (magit-remote-string remote svn-info))
|
||||
(remote-string (magit-remote-string remote remote-branch svn-info))
|
||||
(head (magit-git-string
|
||||
"log" "--max-count=1" "--abbrev-commit" "--pretty=oneline"))
|
||||
(no-commit (not head)))
|
||||
|
|
Loading…
Reference in a new issue