From: Junio C Hamano Date: Sat, 26 Jul 2025 13:45:18 GMT Subject: Re: [PATCH] t9350: redirect input to only fast-import Message-ID: In-Reply-To: <20250725160536.2909011-1-christian.couder@gmail.com> Christian Couder writes: > A number of tests in "t9350-fast-export.sh" are using sub-shells to > redirect content to a number of commands instead of only > `git fast-import`. > > This is confusing and possibly error-prone, so let's change those tests > so that no sub-shell is used and the content goes only to > `git fast-import`. > > Reported-by: Elijah Newren > Signed-off-by: Christian Couder > --- > > This addresses some leftover work discussed in: > > https://lore.kernel.org/git/CABPp-BHM5afgiUf7GsTPWmrf_tm6mWnvHWMKiZPxApJzN-U8gg@mail.gmail.com/ > > > t/t9350-fast-export.sh | 215 +++++++++++++++++------------------------ > 1 file changed, 91 insertions(+), 124 deletions(-) > > diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh > index 46700dbc40..8f85c69d62 100755 > --- a/t/t9350-fast-export.sh > +++ b/t/t9350-fast-export.sh > @@ -48,12 +48,11 @@ test_expect_success 'fast-export | fast-import' ' > mkdir new && > git --git-dir=new/.git init && > git fast-export --all >actual && > - (cd new && > - git fast-import && > - test $MAIN = $(git rev-parse --verify refs/heads/main) && > - test $REIN = $(git rev-parse --verify refs/tags/rein) && > - test $WER = $(git rev-parse --verify refs/heads/wer) && > - test $MUSS = $(git rev-parse --verify refs/tags/muss)) + git -C new fast-import + test $MAIN = $(git -C new rev-parse --verify refs/heads/main) && > + test $REIN = $(git -C new rev-parse --verify refs/tags/rein) && > + test $WER = $(git -C new rev-parse --verify refs/heads/wer) && > + test $MUSS = $(git -C new rev-parse --verify refs/tags/muss) That's a great simplification, especially with the use of "git -C " construct to move there just for that single command. Very nice.