mirror of
https://github.com/git/git.git
synced 2026-04-14 10:50:06 +02:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
c5c0548d79
commit
76655e8a28
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user