Re: [PATCH] t9350: redirect input to only fast-import

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Couder <christian.couder@xxxxxxxxx> 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 <newren@xxxxxxxxx>
> Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
> ---
>
> This addresses some leftover work discussed in:
>
> https://lore.kernel.org/git/CABPp-BHM5afgiUf7GsTPWmrf_tm6mWnvHWMKiZPxApJzN-U8gg@xxxxxxxxxxxxxx/
>
>
> 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)) <actual
> +	git -C new fast-import <actual &&
> +	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
<there>" construct to move there just for that single command.  Very
nice.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux