From 809a5cb81c465a5deb6c109eca53d605ce49a109 Mon Sep 17 00:00:00 2001 From: Alan Falloon Date: Wed, 28 Apr 2010 09:35:50 +0800 Subject: [PATCH] Use just the branch name for unpushed/unpulled when the remote is "." When the remote is "." it signifies that the current branch is tracking another local branch, not a branch in one of the remotes. So, in that case, use just the branch name as the upstream branch instead of the "remote/branch" naming scheme. --- magit.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index 2f8e8a4a..548b610d 100644 --- a/magit.el +++ b/magit.el @@ -2441,17 +2441,23 @@ insert a line to tell how to insert more of them" (or magit-marked-commit (error "No commit marked"))) +(defun magit-remote-branch-name (remote branch) + "Get the name of the branch BRANCH on remote REMOTE" + (if (string= remote ".") branch (concat remote "/" branch))) + (defun magit-insert-unpulled-commits (remote branch) (magit-git-section 'unpulled "Unpulled commits:" 'magit-wash-log "log" "--pretty=format:* %H %s" - (format "HEAD..%s/%s" remote branch))) + (format "HEAD..%s" + (magit-remote-branch-name remote branch)))) (defun magit-insert-unpushed-commits (remote branch) (magit-git-section 'unpushed "Unpushed commits:" 'magit-wash-log "log" "--pretty=format:* %H %s" - (format "%s/%s..HEAD" remote branch))) + (format "%s..HEAD" + (magit-remote-branch-name remote branch)))) (defun magit-insert-unpulled-svn-commits (&optional use-cache) (magit-git-section 'svn-unpulled