summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-07-09 15:25:35 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-09 15:25:36 -0700
commit0cc593998629829402d6b52e13fb424b8614985a (patch)
treec73c11ab5b25e4f0eb4c1843521276a4482f1ff9 /contrib
parentMerge branch 'js/mergetool-optim' (diff)
parentcompletion: do not cache if --git-completion-helper fails (diff)
downloadtgif-0cc593998629829402d6b52e13fb424b8614985a.tar.xz
Merge branch 'nd/completion-no-cache-failure'
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')
-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