From b261669efe6ad7e5f73004f1a546d57dec070568 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Tue, 30 Mar 2010 22:45:59 +0100 Subject: [PATCH] Have `magit--branch-name-from-line' pull out the branch name. --- magit.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index 0b617443..a3f67698 100644 --- a/magit.el +++ b/magit.el @@ -3569,8 +3569,8 @@ Prefix arg means justify as well." "Extract the branch name from one line of 'git branch' output. Will remove the 'remotes/' prefix if it exists." (save-match-data - (if (string-match "^[[:blank:]]*\\*?[[:blank:]]+\\(remotes/\\)?\\([^[:blank:]]+\\)[[:blank:]]" line) - (match-string 2 line)))) + (if (string-match " \\([^ ]+\\)$" line) + (match-string 1 line)))) (defun magit--branch-name-at-point () "Get the branch name in the line at point."