summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-06-08 18:06:29 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-08 18:06:29 -0700
commita8ecd0190d743f19d20917197f95317955354941 (patch)
tree1af53fca7e09fe57e7fbcf5c245917a2fdf37250
parentMerge branch 'rs/fsck-duplicate-names-in-trees' (diff)
parentcompletion: don't override given stash subcommand with -p (diff)
downloadtgif-a8ecd0190d743f19d20917197f95317955354941.tar.xz
Merge branch 'vs/complete-stash-show-p-fix'
The command line completion script (in contrib/) tried to complete "git stash -p" as if it were "git stash push -p", but it was too aggressive and also affected "git stash show -p", which has been corrected. * vs/complete-stash-show-p-fix: completion: don't override given stash subcommand with -p
-rw-r--r--contrib/completion/git-completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ad6934a386..4b59004847 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2782,7 +2782,7 @@ _git_stash ()
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
local subcommands='push list show apply clear drop pop create branch'
local subcommand="$(__git_find_on_cmdline "$subcommands save")"
- if [ -n "$(__git_find_on_cmdline "-p")" ]; then
+ if [ -z "$subcommand" -a -n "$(__git_find_on_cmdline "-p")" ]; then
subcommand="push"
fi
if [ -z "$subcommand" ]; then