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
This commit is contained in:
Junio C Hamano 2019-07-09 15:25:35 -07:00
commit 0cc5939986

View File

@ -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