Skip to content

Commit 76655e8

Browse files
scopgitster
authored andcommitted
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ä <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c5c0548 commit 76655e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ __git_pretty_aliases ()
11291129
# __git_aliased_command requires 1 argument
11301130
__git_aliased_command ()
11311131
{
1132-
local cur=$1 last list word cmdline
1132+
local cur=$1 last list= word cmdline
11331133

11341134
while [[ -n "$cur" ]]; do
11351135
if [[ "$list" == *" $cur "* ]]; then

0 commit comments

Comments
 (0)