summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorFabian Wermelinger <fabianw@mavt.ethz.ch>2021-06-18 14:02:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-06-19 06:30:35 (GMT)
commitcea232194d4da32696df26f9b5ad00d5624621db (patch)
tree46140655549f66d32a4850f11d489781ce4ea2e1 /contrib/completion/git-completion.bash
parent7cdb0969037418b6f09b0a434e51cbf66090c624 (diff)
downloadgit-cea232194d4da32696df26f9b5ad00d5624621db.zip
git-cea232194d4da32696df26f9b5ad00d5624621db.tar.gz
git-cea232194d4da32696df26f9b5ad00d5624621db.tar.bz2
completion: bash: fix late declaration of __git_cmd_idx
A recent update to contrib/completion/git-completion.bash causes bash to fail auto complete custom commands that are wrapped with __git_func_wrap. Declaring __git_cmd_idx=0 inside __git_func_wrap resolves the issue. Signed-off-by: Fabian Wermelinger <fabianw@mavt.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 7bce9a0..7b1bbb9 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3506,6 +3506,7 @@ fi
__git_func_wrap ()
{
local cur words cword prev
+ local __git_cmd_idx=0
_get_comp_words_by_ref -n =: cur words cword prev
$1
}