summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2021-04-16 19:19:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-16 20:40:52 (GMT)
commit76655e8a28d35c7243fa8f138c90a123aa32357f (patch)
tree0c1f6d2b7c13c5195ec4bc8728656e4c1394105c /contrib/completion
parentc5c0548d793edf4a6e319f237f3a01a1f093bbd7 (diff)
downloadgit-76655e8a28d35c7243fa8f138c90a123aa32357f.zip
git-76655e8a28d35c7243fa8f138c90a123aa32357f.tar.gz
git-76655e8a28d35c7243fa8f138c90a123aa32357f.tar.bz2
completion: avoid aliased command lookup error in nounset mode
Aliased command lookup accesses the `list` variable before it has been set, causing an error in "nounset" mode. Initialize to an empty string to avoid that. $ git nonexistent-command <Tab>bash: list: unbound variable Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1de74f1..cd3b13b 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1129,7 +1129,7 @@ __git_pretty_aliases ()
# __git_aliased_command requires 1 argument
__git_aliased_command ()
{
- local cur=$1 last list word cmdline
+ local cur=$1 last list= word cmdline
while [[ -n "$cur" ]]; do
if [[ "$list" == *" $cur "* ]]; then