Thread (11 messages) 11 messages, 3 authors, 2022-09-22

Re: [PATCH 1/2] clone: allow "--bare" with "-o"

From: Eric Sunshine <hidden>
Date: 2022-09-22 06:40:58

On Thu, Sep 22, 2022 at 2:35 AM Jeff King [off-list ref] wrote:
On Thu, Sep 22, 2022 at 02:26:09AM -0400, Eric Sunshine wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help