Skip to content

Commit d7805bc

Browse files
scopgitster
authored andcommitted
completion: protect prompt against unset SHOWUPSTREAM in nounset mode
As it stands, the only call site of `__git_ps1_show_upstream` checks that the `GIT_PS1_SHOWUPSTREAM` variable is set, so this is effectively a no-op. However, that might change, and chances of noticing the unprotected use might not be that high when it does. Signed-off-by: Ville Skyttä <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 758b4e1 commit d7805bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-prompt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ __git_ps1_show_upstream ()
141141

142142
# parse configuration values
143143
local option
144-
for option in ${GIT_PS1_SHOWUPSTREAM}; do
144+
for option in ${GIT_PS1_SHOWUPSTREAM-}; do
145145
case "$option" in
146146
git|svn) upstream_type="$option" ;;
147147
verbose) verbose=1 ;;

0 commit comments

Comments
 (0)