From d7be60af1cb7cf16e6b11952de5db99c9bed7e36 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 7 Jun 2009 21:41:09 +0300 Subject: [PATCH] Don't allow slashes in remote nicknames. * magit.el (magit-list-interesting-refs): Here. (magit-maybe-create-local-tracking-branch): And here. --- magit.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/magit.el b/magit.el index 931958dc..b5d6fb3c 100644 --- a/magit.el +++ b/magit.el @@ -384,7 +384,7 @@ Many Magit faces inherit from this one by default." ((string-match "refs/tags/\\(.*\\)" ref) (push (cons (format "%s (tag)" (match-string 1 ref)) ref) refs)) - ((string-match "refs/remotes/\\([^/]+\\)/\\([^/]+\\)" ref) + ((string-match "refs/remotes/\\([^/]+\\)/\\(.+\\)" ref) (push (cons (format "%s (%s)" (match-string 2 ref) (match-string 1 ref)) @@ -1999,8 +1999,8 @@ in log buffer." ;;; Branches -(defun magit-maybe-create-localtracking-branch (rev) - (if (string-match "^refs/remotes/\\(.*\\)/\\([^/]*\\)" rev) +(defun magit-maybe-create-local-tracking-branch (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))) @@ -2013,7 +2013,7 @@ in log buffer." (defun magit-checkout (rev) (interactive (list (magit-read-rev "Switch to" (magit-default-rev)))) (if rev - (if (not (magit-maybe-create-localtracking-branch rev)) + (if (not (magit-maybe-create-local-tracking-branch rev)) (magit-run-git "checkout" (magit-rev-to-git rev))))) (defun magit-read-create-branch-args ()