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".
This commit is contained in:
parent
8bcbcb369e
commit
043f4383de
1 changed files with 6 additions and 1 deletions
7
magit.el
7
magit.el
|
@ -4025,7 +4025,12 @@ Return values:
|
||||||
|
|
||||||
(defun magit--branch-name-from-line (line)
|
(defun magit--branch-name-from-line (line)
|
||||||
"Extract the branch name from line LINE of 'git branch' output."
|
"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 ()
|
(defun magit--branch-name-at-point ()
|
||||||
"Get the branch name in the line at point."
|
"Get the branch name in the line at point."
|
||||||
|
|
Loading…
Reference in a new issue