Re: [PATCH 1/2] subtree: fix the GIT_EXEC_PATH sanity check to work on Windows
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 16, 2021, 00:52 UTC
- Message-ID
- <xmqq8s3avdf1.fsf@gitster.g>
- In-Reply-To
- <YMiHX6H/k1Z8C6Ws@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
>> So,... is contrib/subtree for Windows only? > > I read it as "this workaround is needed only on Windows, and will kick > in only there; on other platforms, the "-ef" code will not run at all, > so we don't have to worry about its portability".
Yes, in the latest round that I queued yesterday, it is clear that the use of non-POSIX "test" comes after the original condition followed by "||", and even if "test" may sometimes be a builtin, I do not think we will trigger an error at parse-time [*1*], so it is a safe change.
Thanks.
[Footnote]
*1* I recall we had one interesting breakage of a script that tried
to do what is essentially: if are we running a shell with that funky feature?
then
shell commands that use the funky feature
else
portable POSIX shell feature
fi but the part that were supposed to be excluded from the
"portable" codepath by being between "then" and "else" still
were parsed and caused a parse error.