completion: fix issue with process substitution not working on Git for Windows

Git for Windows comes with a bash that doesn't support process substitution. It issues the following error when using git-completion.bash with GIT_PS1_SHOWUPSTREAM set: $ export GIT_PS1_SHOWUPSTREAM=1 sh.exe": cannot make pipe for process substitution: Function not implemented sh.exe": cannot make pipe for process substitution: Function not implemented sh.exe": <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n '): ambiguous redirect Replace the process substitution with a 'here string'. Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Naewe committed Oct 26, 2011 at 21:13 UTC e5b8eebc03f80bc21877494ae2ac0c2b63a1b83b
1 file changed +2 -1
contrib/completion/git-completion.bash
+2 -1
@@ -110,6 +110,7 @@ __git_ps1_show_upstream ()
110 local upstream=git legacy="" verbose=""
111
112 # get some config options from git-config
113 + output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
114 while read key value; do
115 case "$key" in
116 bash.showupstream)
@@ -125,7 +126,7 @@ __git_ps1_show_upstream ()
126 upstream=svn+git # default upstream is SVN if available, else git
127 ;;
128 esac
128 - done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
129 + done <<< "$output"
130
131 # parse configuration values
132 for option in ${GIT_PS1_SHOWUPSTREAM}; do