summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-07-29 12:38:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-29 12:38:20 -0700
commit39521d07bedc4a8f1f8891ff1bc0a5b34213504f (patch)
tree2e260006ebaada1896edfd50a937949692167102 /contrib/completion
parentMerge branch 'rs/config-unit-parsing' into maint (diff)
parentcompletion: do not cache if --git-completion-helper fails (diff)
downloadtgif-39521d07bedc4a8f1f8891ff1bc0a5b34213504f.tar.xz
Merge branch 'nd/completion-no-cache-failure' into maint
An incorrect list of options was cached after command line completion failed (e.g. trying to complete a command that requires a repository outside one), which has been corrected. * nd/completion-no-cache-failure: completion: do not cache if --git-completion-helper fails
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9f71bcde96..8c6b610a24 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -400,7 +400,8 @@ __gitcomp_builtin ()
if [ -z "$options" ]; then
# leading and trailing spaces are significant to make
# option removal work correctly.
- options=" $incl $(__git ${cmd/_/ } --git-completion-helper) "
+ options=" $incl $(__git ${cmd/_/ } --git-completion-helper) " || return
+
for i in $excl; do
options="${options/ $i / }"
done