Skip to content

Commit a4a1453

Browse files
committed
Merge branch 'vs/complete-with-set-u-fix'
Another "set -u" fix for the bash prompt (in contrib/) script. * vs/complete-with-set-u-fix: completion: protect prompt against unset SHOWUPSTREAM in nounset mode completion: fix prompt with unset SHOWCONFLICTSTATE in nounset mode
2 parents aaf524c + d7805bc commit a4a1453

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/completion/git-prompt.sh

Lines changed: 2 additions & 2 deletions
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 ;;
@@ -528,7 +528,7 @@ __git_ps1 ()
528528
fi
529529

530530
local conflict="" # state indicator for unresolved conflicts
531-
if [[ "${GIT_PS1_SHOWCONFLICTSTATE}" == "yes" ]] &&
531+
if [[ "${GIT_PS1_SHOWCONFLICTSTATE-}" == "yes" ]] &&
532532
[[ $(git ls-files --unmerged 2>/dev/null) ]]; then
533533
conflict="|CONFLICT"
534534
fi

0 commit comments

Comments
 (0)