Allow free form entry of branches, tags, etc.

* magit.el (magit-read-other-branch, magit-read-rev): Renamed former
to latter.  Do not require a match.  Changed all callers.
This commit is contained in:
Marius Vollmer 2008-08-12 00:08:45 +03:00
parent 7d31c70a26
commit 1fab257814

View file

@ -553,13 +553,11 @@ pushed.
(defun magit-list-branches () (defun magit-list-branches ()
(magit-shell-lines "git branch -a | cut -c3-")) (magit-shell-lines "git branch -a | cut -c3-"))
(defun magit-read-other-branch (prompt) (defun magit-read-rev (prompt)
(completing-read prompt (delete (magit-get-current-branch) (completing-read prompt (magit-list-branches)))
(magit-list-branches))
nil t))
(defun magit-switch-branch (branch) (defun magit-switch-branch (branch)
(interactive (list (magit-read-other-branch "Switch to branch: "))) (interactive (list (magit-read-rev "Switch to branch: ")))
(if (and branch (not (string= branch ""))) (if (and branch (not (string= branch "")))
(magit-run "git" "checkout" branch))) (magit-run "git" "checkout" branch)))
@ -579,11 +577,11 @@ pushed.
;;; Merging ;;; Merging
(defun magit-manual-merge (branch) (defun magit-manual-merge (branch)
(interactive (list (magit-read-other-branch "Manually merge from branch: "))) (interactive (list (magit-read-rev "Manually merge from branch: ")))
(magit-run "git" "merge" "--no-ff" "--no-commit" branch)) (magit-run "git" "merge" "--no-ff" "--no-commit" branch))
(defun magit-automatic-merge (branch) (defun magit-automatic-merge (branch)
(interactive (list (magit-read-other-branch "Merge from branch: "))) (interactive (list (magit-read-rev "Merge from branch: ")))
(magit-run "git" "merge" branch)) (magit-run "git" "merge" branch))
;;; Resetting ;;; Resetting
@ -807,7 +805,7 @@ the current line into your working tree.
(defun magit-browse-branch-log () (defun magit-browse-branch-log ()
(interactive) (interactive)
(magit-browse-log (magit-read-other-branch "Browse history of branch: "))) (magit-browse-log (magit-read-rev "Browse history of branch: ")))
;;; Miscellaneous ;;; Miscellaneous