Skip to content

Commit e5b8eeb

Browse files
snaewegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f384a2e commit e5b8eeb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ __git_ps1_show_upstream ()
110110
local upstream=git legacy="" verbose=""
111111

112112
# 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 ')"
113114
while read key value; do
114115
case "$key" in
115116
bash.showupstream)
@@ -125,7 +126,7 @@ __git_ps1_show_upstream ()
125126
upstream=svn+git # default upstream is SVN if available, else git
126127
;;
127128
esac
128-
done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
129+
done <<< "$output"
129130

130131
# parse configuration values
131132
for option in ${GIT_PS1_SHOWUPSTREAM}; do

0 commit comments

Comments
 (0)