path: root/contrib/completion
diff options
authorSibo Dong <>2020-10-31 22:09:46 (GMT)
committerJunio C Hamano <>2020-11-02 00:22:11 (GMT)
commit9542d56379b60bb97d17ae1d1c8e8e4bc1fd65a3 (patch)
tree35f4701ef65fe2d8617b65d9f4668cd312204a7f /contrib/completion
parent898f80736c75878acc02dc55672317fcc0e0a5a6 (diff)
git-9542d56379b60bb97d17ae1d1c8e8e4bc1fd65a3.tar.bz2 localize `option` in __git_ps1_show_upstream
The variable 'option' is used in __git_ps1_show_upstream() without being localized. This clobbers the variable the user may be using for other purposes, which is bad. Luckily, $option is not used to carry information around in the script as a global variable. The use of it in this script has very limited scope (namely, only inside this function), so just declare that it is "local". Signed-off-by: Sibo Dong <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/completion')
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/completion/ b/contrib/completion/
index 16260ba..5116016 100644
--- a/contrib/completion/
+++ b/contrib/completion/
@@ -137,6 +137,7 @@ __git_ps1_show_upstream ()
done <<< "$output"
# parse configuration values
+ local option
for option in ${GIT_PS1_SHOWUPSTREAM}; do
case "$option" in
git|svn) upstream="$option" ;;