Re: [PATCH 1/2] clone: allow "--bare" with "-o"
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 22, 2022, 06:40 UTC
- Message-ID
- <CAPig+cSwYYD6U0bgHL+8pp+j8wOPRhVc6o6LdkP5eR=vOOy6HQ@mail.gmail.com>
- In-Reply-To
- <YywCImASth7I0Wx2@coredump.intra.peff.net>
On Thu, Sep 22, 2022 at 2:35 AM Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> On Thu, Sep 22, 2022 at 02:26:09AM -0400, Eric Sunshine wrote:
> > I was thinking, in particular, about this snippet from t/test-lib.sh:
> >
> > # git sees Windows-style pwd
> > pwd () {
> > builtin pwd -W
> > }
> >
> > If that's inherited by the subshell used in the test, then I suppose
> > all is okay, though I think it would not be inherited.
>
> I think it's OK. $() is itself a subshell, and you can find many calls
> to FOO=$(pwd) or similar. And in general, functions are inherited in
> subshells:
>
> $ sh -c 'foo() { echo bar; }; (cd .. && foo)'
> bar
>
> They'd have to be or many things in our test suite would break, since we
> use test_must_fail, etc, inside subshells.Yep, thanks for the sanity dose. For some reason, my brain was off-kilter, thinking that it was running a shell afresh, not just using a subshell.