aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-subtree.el
diff options
context:
space:
mode:
authorJustin Burkett <justin@burkett.cc>2017-05-20 14:10:39 -0400
committerKyle Meyer <kyle@kyleam.com>2017-05-22 21:29:31 -0400
commit6c125ca2dc66d951f301ebc36496a90f2e2469ee (patch)
tree0d23558ad1ffaf6c37cf21435317f4932550bd2a /lisp/magit-subtree.el
parent986de740cd8ee4017740c7337048d6b2c885dfcf (diff)
magit-subtree-{add,pull,push}: Add interactive completion
Use more specific magit-read- functions to complete the arguments of these functions when used interactively, instead of the generic magit-read-string-ns.
Diffstat (limited to 'lisp/magit-subtree.el')
-rw-r--r--lisp/magit-subtree.el22
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/magit-subtree.el b/lisp/magit-subtree.el
index 241734a..882177e 100644
--- a/lisp/magit-subtree.el
+++ b/lisp/magit-subtree.el
@@ -90,10 +90,12 @@
;;;###autoload
(defun magit-subtree-add (prefix repository ref args)
"Add REF from REPOSITORY as a new subtree at PREFIX."
- (interactive (list (magit-subtree-prefix "Add subtree")
- (magit-read-string-ns "Repository")
- (magit-read-string-ns "Ref")
- (magit-subtree-args)))
+ (interactive
+ (cons (magit-subtree-prefix "Add subtree")
+ (let ((remote (magit-read-remote-or-url "From repository")))
+ (list remote
+ (magit-read-refspec "Ref" remote)
+ (magit-subtree-args)))))
(magit-git-subtree "add" prefix args repository ref))
;;;###autoload
@@ -115,17 +117,19 @@
;;;###autoload
(defun magit-subtree-pull (prefix repository ref args)
"Pull REF from REPOSITORY into the PREFIX subtree."
- (interactive (list (magit-subtree-prefix "Pull into subtree")
- (magit-read-string-ns "From repository")
- (magit-read-string-ns "Ref")
- (magit-subtree-args)))
+ (interactive
+ (cons (magit-subtree-prefix "Pull into subtree")
+ (let ((remote (magit-read-remote-or-url "From repository")))
+ (list remote
+ (magit-read-refspec "Ref" remote)
+ (magit-subtree-args)))))
(magit-git-subtree "pull" prefix args repository ref))
;;;###autoload
(defun magit-subtree-push (prefix repository ref args)
"Extract the history of the subtree PREFIX and push it to REF on REPOSITORY."
(interactive (list (magit-subtree-prefix "Push subtree")
- (magit-read-string-ns "To repository")
+ (magit-read-remote-or-url "To repository")
(magit-read-string-ns "To reference")
(magit-subtree-args)))
(magit-git-subtree "push" prefix args repository ref))