From 043f4383de30ec20372bbcb5bf818ed489cd6031 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 20 Jun 2010 11:50:14 +0200 Subject: [PATCH] Remove "remotes/" prefix from remote branch names git cannot find a branch named "remotes/repository/branch" with most (all?) of its commands, e.g. "git branch -d -r ..." or "git merge". --- magit.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/magit.el b/magit.el index 1d7d2e85..0de0bfcf 100644 --- a/magit.el +++ b/magit.el @@ -4025,7 +4025,12 @@ Return values: (defun magit--branch-name-from-line (line) "Extract the branch name from line LINE of 'git branch' output." - (get-text-property 0 'branch-name line)) + (let ((branch (get-text-property 0 'branch-name line))) + (if (and branch + (get-text-property 0 'remote line) + (string-match-p "^remotes/" branch)) + (substring branch 8) + branch))) (defun magit--branch-name-at-point () "Get the branch name in the line at point."