summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-09-15 00:27:31 -0400
committerKyle Meyer <kyle@kyleam.com>2015-09-15 00:27:31 -0400
commit78872e800636b43c4b6285882ef96b53ce298929 (patch)
treef1afe421816bff4eba0928a1989378beba4506b8 /lisp
parent9145855d08441be5a7b8324bf4867131bba6e63f (diff)
downloademacs.d-78872e800636b43c4b6285882ef96b53ce298929.tar.gz
magit-checkout-local-tracking: Add at-point default
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-git.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index 5d94c46..b43ee54 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -139,8 +139,11 @@ without requiring confirmation.
"Create and checkout a local tracking branch for REMOTE-BRANCH.
\n(git checkout -t REMOTE-BRANCH\)"
(interactive
- (list (magit-completing-read "Remote branch"
- (magit-list-remote-branch-names))))
+ (list (let ((branches (magit-list-remote-branch-names)))
+ (magit-completing-read
+ "Remote branch" branches nil t nil nil
+ (car (member (magit-branch-or-commit-at-point)
+ branches))))))
(magit-run-git "checkout" "-t" remote-branch))
(defun km/magit-delete-previous-branch (&optional force)