Skip to content

Commit f037e60

Browse files
avihgitster
authored andcommitted
git-prompt: use here-doc instead of here-string
Here-documend is standard, and works in all shells. Both here-string and here-doc add final newline, which is important in this case, because $output is without final newline, but we do want "read" to succeed on the last line as well. Shells which support here-string: - bash, zsh, mksh, ksh93, yash (non-posix-mode). shells which don't, and got fixed: - ash-derivatives (dash, free/net bsd sh, busybox-ash). - pdksh, openbsd sh. - All Schily Bourne shell variants. Signed-off-by: Avi Halachmi (:avih) <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 39bf06a commit f037e60

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/completion/git-prompt.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ __git_ps1_show_upstream ()
137137
upstream_type=svn+git # default upstream type is SVN if available, else git
138138
;;
139139
esac
140-
done <<< "$output"
140+
done <<-OUTPUT
141+
$output
142+
OUTPUT
141143

142144
# parse configuration values
143145
local option

0 commit comments

Comments
 (0)