`magit-maybe-create-local-tracking-branch' allows for no "refs/" string.
This commit is contained in:
parent
b59f493863
commit
78867ac94d
1 changed files with 2 additions and 2 deletions
4
magit.el
4
magit.el
|
@ -2582,7 +2582,7 @@ With prefix argument, add remaining untracked files as well.
|
||||||
;;; Branches
|
;;; Branches
|
||||||
|
|
||||||
(defun magit-maybe-create-local-tracking-branch (rev)
|
(defun magit-maybe-create-local-tracking-branch (rev)
|
||||||
(if (string-match "^refs/remotes/\\([^/]+\\)/\\(.+\\)" rev)
|
(if (string-match "^\\(?:refs/\\)?remotes/\\([^/]+\\)/\\(.+\\)" rev)
|
||||||
(let ((remote (match-string 1 rev))
|
(let ((remote (match-string 1 rev))
|
||||||
(branch (match-string 2 rev)))
|
(branch (match-string 2 rev)))
|
||||||
(when (and (not (magit-ref-exists-p (concat "refs/heads/" branch)))
|
(when (and (not (magit-ref-exists-p (concat "refs/heads/" branch)))
|
||||||
|
@ -4003,7 +4003,7 @@ Return values:
|
||||||
(defun magit-branches-window-checkout ()
|
(defun magit-branches-window-checkout ()
|
||||||
"Check out the branch in the line at point."
|
"Check out the branch in the line at point."
|
||||||
(interactive)
|
(interactive)
|
||||||
(magit-run-git "checkout" (magit--branch-name-at-point))
|
(magit-checkout (magit--branch-name-at-point))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(magit-show-branches)))
|
(magit-show-branches)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue