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 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/magit.el b/magit.el
index 6d57932..2ddef79 100644
--- a/magit.el
+++ b/magit.el
@@ -4032,7 +4032,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."
-- 
1.7.0.4

Reply via email to