diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-29 22:38:20 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-29 22:38:20 +0300 |
commit | 39521d07bedc4a8f1f8891ff1bc0a5b34213504f (patch) | |
tree | 2e260006ebaada1896edfd50a937949692167102 | |
parent | 97cb523f00d8c7ec0b85dd768f321ae1c70e05d7 (diff) | |
parent | 69702523afb4de692b415648e53fcfb1b4630f18 (diff) |
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
-rw-r--r-- | contrib/completion/git-completion.bash | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9f71bcde967..8c6b610a244 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 |