t/t1*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Beat Bolli committed Mar 15, 2024 at 20:46 UTC 2ed139ccc935f9bacc670e7be32694657918e84d
2 files changed +4 -4
t/t1007-hash-object.sh
+3 -3
@@ -124,8 +124,8 @@ test_expect_success 'check that appropriate filter is invoke when --path is used
124 path0_sha=$(git hash-object --path=file0 file1) &&
125 test "$file0_sha" = "$path0_sha" &&
126 test "$file1_sha" = "$path1_sha" &&
127 - path1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&
128 - path0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&
127 + path1_sha=$(git hash-object --path=file1 --stdin <file0) &&
128 + path0_sha=$(git hash-object --path=file0 --stdin <file1) &&
129 test "$file0_sha" = "$path0_sha" &&
130 test "$file1_sha" = "$path1_sha"
131 '
@@ -154,7 +154,7 @@ test_expect_success '--path works in a subdirectory' '
154 test_expect_success 'check that --no-filters option works' '
155 nofilters_file1=$(git hash-object --no-filters file1) &&
156 test "$file0_sha" = "$nofilters_file1" &&
157 - nofilters_file1=$(cat file1 | git hash-object --stdin) &&
157 + nofilters_file1=$(git hash-object --stdin <file1) &&
158 test "$file0_sha" = "$nofilters_file1"
159 '
160
t/t1091-sparse-checkout-builtin.sh
+1 -1
@@ -968,7 +968,7 @@ test_expect_success 'check-rules non-cone mode' '
968 git -C bare sparse-checkout check-rules --no-cone --rules-file ../rules\
969 >check-rules-file <all-files &&
970
971 - cat rules | git -C repo sparse-checkout set --no-cone --stdin &&
971 + git -C repo sparse-checkout set --no-cone --stdin <rules &&
972 git -C repo ls-files -t >out &&
973 sed -n "/^S /!s/^. //p" out >ls-files &&
974