`magit-maybe-create-local-tracking-branch' allows for no "refs/" string.

This commit is contained in:
Phil Jackson 2010-06-09 21:57:10 +01:00
parent b59f493863
commit 78867ac94d

View file

@ -2582,7 +2582,7 @@ With prefix argument, add remaining untracked files as well.
;;; Branches
(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))
(branch (match-string 2 rev)))
(when (and (not (magit-ref-exists-p (concat "refs/heads/" branch)))
@ -4003,7 +4003,7 @@ Return values:
(defun magit-branches-window-checkout ()
"Check out the branch in the line at point."
(interactive)
(magit-run-git "checkout" (magit--branch-name-at-point))
(magit-checkout (magit--branch-name-at-point))
(save-excursion
(magit-show-branches)))