bash prompt: avoid command substitution when finalizing gitstring
commit69a8141a5d81925b7e08cb228535e9ea4a7a02e3
authorSZEDER Gábor <szeder@ira.uka.de>
Mon, 17 Jun 2013 19:42:55 +0000 (17 21:42 +0200)
committerSZEDER Gábor <szeder@ira.uka.de>
Mon, 24 Jun 2013 16:03:37 +0000 (24 18:03 +0200)
treeb2ca3c8372beedbb4c7fa52fd461c042f8be2b98
parent14d7649748265fe9fe991439ca6ae0c9db7a27ab
bash prompt: avoid command substitution when finalizing gitstring

Before setting $PS1, __git_ps1() uses a command substitution to
redirect the output from a printf into a variable.  Spare the overhead
of fork()ing a subshell by using 'printf -v <var>' to directly assign
the output to that variable.

zsh's printf doesn't support the '-v <var>' option, so stick with the
command substitution when under zsh.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
contrib/completion/git-prompt.sh