]> git.ipfire.org Git - thirdparty/git.git/commit - contrib/completion/git-prompt.sh
git-prompt.sh: localize `option` in __git_ps1_show_upstream
authorSibo Dong <sibo.dong@outlook.com>
Sat, 31 Oct 2020 22:09:46 +0000 (22:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Nov 2020 00:22:11 +0000 (16:22 -0800)
commit9542d56379b60bb97d17ae1d1c8e8e4bc1fd65a3
tree35f4701ef65fe2d8617b65d9f4668cd312204a7f
parent898f80736c75878acc02dc55672317fcc0e0a5a6
git-prompt.sh: 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 <sibo.dong@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-prompt.sh