Merge branch 'jg/prompt-localize-temporary'
authorJunio C Hamano <gitster@pobox.com>
Mon, 22 Dec 2014 20:28:20 +0000 (12:28 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Dec 2014 20:28:20 +0000 (12:28 -0800)
"git-prompt" (in contrib/) used a variable from the global scope,
possibly contaminating end-user's namespace.

* jg/prompt-localize-temporary:
git-prompt.sh: make $f local to __git_eread()

contrib/completion/git-prompt.sh
index c5473dc8dba78b372fd95ef2bf5257ff5cdc3baf..729f7694795d1116ccedfc653f82da757e6e4ef4 100644 (file)
@@ -270,7 +270,7 @@ __git_ps1_colorize_gitstring ()
 
 __git_eread ()
 {
-       f="$1"
+       local f="$1"
        shift
        test -r "$f" && read "$@" <"$f"
 }