SZEDER Gábor  committed 4804d43

completion: don't leak variable from the prompt into environment

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
done <<-EOF
$(git config -z --get-regexp ...)

Signed-off-by: SZEDER Gábor <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits e5b8eeb
  • Branches master

Comments (0)

Files changed (1)

File contrib/completion/git-completion.bash

 	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