Re: [PATCH 14/22] t/t9*: avoid redundant uses of cat
On Tue, Mar 05, 2024 at 10:25:13PM +0100, Beat Bolli wrote:
Show 21 quoted lines
> Signed-off-by: Beat Bolli <dev+git@drbeat.li>
> ---
> 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.
Show 8 quoted lines
> 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.
Show 7 quoted lines
> '
> @@ -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 &&
Show 9 quoted lines
> 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 &&Show 9 quoted lines
> 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 &&