summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2015-06-07 23:49:32 +0200
committerDaniel Hahler <git@thequod.de>2015-06-08 00:35:01 +0200
commite8cf611879a2d9e6bf84af0dabaa1ff985c96f4e (patch)
tree14f393570a6334e3c16701b8cf398b76d743ae61
parentac26fafa03c30e8c79e4bd70bdbb68d025643ee7 (diff)
downloadzsh-e8cf611879a2d9e6bf84af0dabaa1ff985c96f4e.tar.gz
zsh-e8cf611879a2d9e6bf84af0dabaa1ff985c96f4e.zip
35216: _git-checkout: do not call __git_commits twice
This makes `branch_arg` empty by default, to be used only for __git_remote_branch_names. `branches::__git_revisions` was used here, but that's the same as tree_ish_arg='tree-ishs::__git_tree_ishs' - both call __git_commits. Only tree_ish_arg will call __git-commits now.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e4b3ed77b..8dfdbc5cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-08 Daniel Hahler <zsh@thequod.de>
+
+ * 35216: Completion/Unix/Command/_git: _git-checkout: do not call
+ __git_commits twice.
+
2015-06-07 Oliver Kiddle <opk@zsh.org>
* 35412: Src/builtin.c, Test/B03print.ztst: fix for - flag
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index b8edc109e..088a7dbb7 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -456,14 +456,13 @@ _git-checkout () {
[[ $line[CURRENT] = -* ]] && return
if (( CURRENT == 1 )) && [[ -z $opt_args[(I)--] ]]; then
# TODO: Allow A...B
- local branch_arg='branches::__git_revisions' \
+ local branch_arg='' \
remote_branch_noprefix_arg='remote branches::__git_remote_branch_names_noprefix' \
tree_ish_arg='tree-ishs::__git_tree_ishs' \
file_arg='modified-files::__git_modified_files'
if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then
remote_branch_noprefix_arg=
- tree_ish_arg=
file_arg=
elif [[ -n $opt_args[(I)--track] ]]; then
branch_arg='remote-branches::__git_remote_branch_names'
@@ -471,7 +470,6 @@ _git-checkout () {
tree_ish_arg=
file_arg=
elif [[ -n ${opt_args[(I)--ours|--theirs|-m|--conflict|--patch]} ]]; then
- branch_arg=
remote_branch_noprefix_arg=
fi