Re: [RFC/PATCH] git-completion.bash: remove bashism to fix ZSH compatibility
- From
Paul Smith <paul@mad-scientist.net>
- Date
- Mar 11, 2013, 18:19 UTC
- Message-ID
- <1363025984.24833.19.camel@pdsdesk>
- In-Reply-To
- <7vwqtd95bm.fsf@alter.siamese.dyndns.org>
On Mon, 2013-03-11 at 11:09 -0700, Junio C Hamano wrote:
> So strictly speaking there is no reason for an extra subshell here, > but writing this in the way the patch does makes our intention > crystal clear, I think.
If you're concerned about the extra processing of the new shell you can use {} instead of ():
{
test -n "${CDPATH+set}" && unset CDPATH
# NOTE: $2 is not quoted in order to support multiple options
cd "$1" && git ls-files --exclude-standard $2
} 2>/dev/nullZsh does support this properly in my testing. It's only redirection of an entire function body, as the original, that is working differently in zsh and bash.