Re: [PATCH 14/22] t/t9*: avoid redundant uses of cat

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

 



On Tue, Mar 05, 2024 at 10:25:13PM +0100, Beat Bolli wrote:
> Signed-off-by: Beat Bolli <dev+git@xxxxxxxxx>
> ---
>  t/t9300-fast-import.sh          | 10 +++++-----
>  t/t9350-fast-export.sh          |  2 +-
>  t/t9400-git-cvsserver-server.sh | 35 +++++++++++++++------------------
>  t/t9802-git-p4-filetype.sh      |  2 +-
>  t/t9807-git-p4-submit.sh        |  2 +-
>  t/t9824-git-p4-git-lfs.sh       |  4 ++--
>  6 files changed, 26 insertions(+), 29 deletions(-)
> 
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index dbb5042b0b8f..c03adbdd145f 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -986,7 +986,7 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' '
>  	test_when_finished "git update-ref -d refs/heads/L2" &&
>  	git fast-import <input &&
>  	git ls-tree L2 g/b/ >tmp &&
> -	cat tmp | cut -f 2 >actual &&
> +	cut -f 2 <tmp >actual &&
>  	test_cmp expect actual &&

Nit: Maybe we can avoid tmp.

>  	git fsck $(git rev-parse L2)
>  '
> @@ -2012,7 +2012,7 @@ test_expect_success 'Q: verify first notes tree' '
>  	100644 blob $commit2
>  	100644 blob $commit3
>  	EOF
> -	cat expect.unsorted | sort >expect &&
> +	sort expect.unsorted >expect &&

Nit: I wonder if we can also avoid the cat that just precedes this hunk.

>  '
> @@ -2053,7 +2053,7 @@ test_expect_success 'Q: verify second notes tree' '
>  	100644 blob $commit2
>  	100644 blob $commit3
>  	EOF
> -	cat expect.unsorted | sort >expect &&
> +	sort expect.unsorted >expect &&

Ditto.

>  	git cat-file -p refs/notes/foobar^^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
>  	test_cmp expect actual
>  '
> @@ -2091,7 +2091,7 @@ test_expect_success 'Q: verify third notes tree' '
>  	cat >expect.unsorted <<-EOF &&
>  	100644 blob $commit1
>  	EOF
> -	cat expect.unsorted | sort >expect &&
> +	sort expect.unsorted >expect &&

Ditto.

>  	git cat-file -p refs/notes/foobar2^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
>  	test_cmp expect actual
>  '
> @@ -2118,7 +2118,7 @@ test_expect_success 'Q: verify fourth notes tree' '
>  	cat >expect.unsorted <<-EOF &&
>  	100644 blob $commit2
>  	EOF
> -	cat expect.unsorted | sort >expect &&
> +	sort expect.unsorted >expect &&

Ditto.




[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