prompt: fix show upstream with svn and zsh
Currently the __git_ps1 git prompt gives the following error with a repository converted by git-svn, when used with zsh: __git_ps1_show_upstream:19: bad pattern: svn_remote[ __git_ps1_show_upstream:45: bad substitution To reproduce the problem, the __git_ps1_show_upstream function can be executed in a repository converted with git-svn. Both those errors are triggered by spaces after the '['. Zsh also doesn't support initializing an array with `local var=(...)`. This triggers the following error: __git_ps1_show_upstream:41: bad pattern: svn_upstream=(commit Use local -a var=(...) instead to make is compatible. This was introduced by 6d158cba (bash completion: Support "divergence from upstream" messages in __git_ps1), when the script was for bash only. Signed-off-by: NThomas Gummerer <t.gummerer@gmail.com> Acked-by: NFelipe Contreras <felipe.contreras@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录