From 74615c2a748ad51c8a04e5f06a427497b93a0dcd Mon Sep 17 00:00:00 2001 From: Beat Bolli Date: Fri, 15 Mar 2024 20:46:03 +0100 Subject: [PATCH] t/t0*: avoid redundant uses of cat Signed-off-by: Beat Bolli Acked-by: Taylor Blau Signed-off-by: Junio C Hamano --- t/t0002-gitfile.sh | 2 +- t/t0011-hashmap.sh | 2 +- t/t0028-working-tree-encoding.sh | 4 ++-- t/t0204-gettext-reencode-sanity.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh index 736516cc6a..bf3bf604ab 100755 --- a/t/t0002-gitfile.sh +++ b/t/t0002-gitfile.sh @@ -40,7 +40,7 @@ test_expect_success 'final setup + check rev-parse --git-dir' ' test_expect_success 'check hash-object' ' echo "foo" >bar && - SHA=$(cat bar | git hash-object -w --stdin) && + SHA=$(git hash-object -w --stdin > expect && echo size >> in && echo 64 39 >> expect && - cat in | test-tool hashmap > out && + test-tool hashmap out && test_cmp expect out ' diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index 1b55f59c23..ad151a3467 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -131,8 +131,8 @@ do test_when_finished "rm -f crlf.utf${i}.raw lf.utf${i}.raw" && test_when_finished "git reset --hard HEAD^" && - cat lf.utf8.raw | write_utf${i} >lf.utf${i}.raw && - cat crlf.utf8.raw | write_utf${i} >crlf.utf${i}.raw && + write_utf${i} lf.utf${i}.raw && + write_utf${i} crlf.utf${i}.raw && cp crlf.utf${i}.raw eol.utf${i} && cat >expectIndexLF <<-EOF && diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh index 4f2e0dcb02..310a450012 100755 --- a/t/t0204-gettext-reencode-sanity.sh +++ b/t/t0204-gettext-reencode-sanity.sh @@ -82,7 +82,7 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext.c: git init UTF-8 -> ISO-8859-1' printf "Bjó til tóma Git lind" >expect && LANGUAGE=is LC_ALL="$is_IS_iso_locale" git init repo >actual && test_when_finished "rm -rf repo" && - grep "^$(cat expect | iconv -f UTF-8 -t ISO8859-1) " actual + grep "^$(iconv -f UTF-8 -t ISO8859-1