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>

Ville Skyttä committed Apr 16, 2021 at 22:19 UTC 76655e8a28d35c7243fa8f138c90a123aa32357f
1 file changed +1 -1
contrib/completion/git-completion.bash
+1 -1
@@ -1129,7 +1129,7 @@ __git_pretty_aliases ()
1129 # __git_aliased_command requires 1 argument
1130 __git_aliased_command ()
1131 {
1132 - local cur=$1 last list word cmdline
1132 + local cur=$1 last list= word cmdline
1133
1134 while [[ -n "$cur" ]]; do
1135 if [[ "$list" == *" $cur "* ]]; then