{"thread":{"id":"61244","subject":"[PATCH] completion: protect prompt against unset SHOWUPSTREAM in nounset mode","startedAt":"2024-04-01T19:08:15Z","lastAt":"2024-04-01T19:08:15Z","messageCount":1,"participants":["Ville Skyttä"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"491973","messageId":"20240401190751.8676-1-ville.skytta@iki.fi","threadId":"61244","inReplyTo":null,"subject":"[PATCH] completion: protect prompt against unset SHOWUPSTREAM in nounset mode","fromName":"Ville Skyttä","fromEmail":"ville.skytta@iki.fi","sentAt":"2024-04-01T19:07:51Z","receivedAt":"2024-04-01T19:08:15Z","isPatch":true,"sender":{"key":"ville.skytta@iki.fi","avatar":"https://avatars.githubusercontent.com/u/109152?v=4"},"body":"As it stands, the only call site of `__git_ps1_show_upstream` checks\nthat the `GIT_PS1_SHOWUPSTREAM` variable is set, so this is effectively\na no-op. However, that might change, and chances of noticing the\nunprotected use might not be that high when it does.\n\nSigned-off-by: Ville Skyttä <ville.skytta@iki.fi>\n---\n contrib/completion/git-prompt.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh\nindex 3826f52dec..5330e769a7 100644\n--- a/contrib/completion/git-prompt.sh\n+++ b/contrib/completion/git-prompt.sh\n@@ -141,7 +141,7 @@ __git_ps1_show_upstream ()\n \n \t# parse configuration values\n \tlocal option\n-\tfor option in ${GIT_PS1_SHOWUPSTREAM}; do\n+\tfor option in ${GIT_PS1_SHOWUPSTREAM-}; do\n \t\tcase \"$option\" in\n \t\tgit|svn) upstream_type=\"$option\" ;;\n \t\tverbose) verbose=1 ;;\n-- \n2.40.1\n\n"}]}