Subject: Re: [PATCH 1/2] subtree: fix the GIT_EXEC_PATH sanity check to work on Windows

From: Junio C Hamano <[email-masked]>
Date: Wed, 16 Jun 2021 09:52:34 +0900

Jeff King <[email-masked]> writes:

>> 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.