diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-04-10 10:00:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-10 10:00:08 -0700 |
commit | a4a1453ad173c61663dceed2452d21616ee46b44 (patch) | |
tree | cffc4fd11fa5a504d73e1df7602831dc16392a3d | |
parent | aaf524cfb0707c28c3f9a08598a33abf11b24435 (diff) | |
parent | d7805bc74351e61126e587a7470e3fbf843caf8a (diff) | |
download | git-a4a1453ad173c61663dceed2452d21616ee46b44.tar.gz |
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
-rw-r--r-- | contrib/completion/git-prompt.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index 71f179cba3..5330e769a7 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -141,7 +141,7 @@ __git_ps1_show_upstream () # parse configuration values local option - for option in ${GIT_PS1_SHOWUPSTREAM}; do + for option in ${GIT_PS1_SHOWUPSTREAM-}; do case "$option" in git|svn) upstream_type="$option" ;; verbose) verbose=1 ;; @@ -528,7 +528,7 @@ __git_ps1 () fi local conflict="" # state indicator for unresolved conflicts - if [[ "${GIT_PS1_SHOWCONFLICTSTATE}" == "yes" ]] && + if [[ "${GIT_PS1_SHOWCONFLICTSTATE-}" == "yes" ]] && [[ $(git ls-files --unmerged 2>/dev/null) ]]; then conflict="|CONFLICT" fi |