From 4804d437916d08068143dfc265cc7b5e2f4883e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?SZEDER=20G=C3=A1bor?= Date: Wed, 9 Nov 2011 11:02:50 +0100 Subject: [PATCH] completion: don't leak variable from the prompt into environment MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Commit e5b8eebc (completion: fix issue with process substitution not working on Git for Windows, 2011-10-26) introduced a new variable in __git_ps1_show_upstream(), but didn't declare it as local to prevent it from leaking into the environment. We may want to rewrite it like the following, but that can wait until the next cycle. while read key value do ... done <<-EOF $(git config -z --get-regexp ...) EOF Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index fc3d0b1a06..32df141f91 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -110,7 +110,7 @@ __git_ps1_show_upstream () local upstream=git legacy="" verbose="" # get some config options from git-config - output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')" + local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')" while read key value; do case "$key" in bash.showupstream) -- 2.32.0.93.g670b81a890