]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t1*: avoid redundant uses of cat
authorBeat Bolli <bb@drbeat.li>
Fri, 15 Mar 2024 19:46:04 +0000 (20:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 Mar 2024 18:08:56 +0000 (11:08 -0700)
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>
t/t1007-hash-object.sh
t/t1091-sparse-checkout-builtin.sh

index ac3d173767ae72be7bc43e4df269d88fb040f7ba..64aea3848606ccda03b5dd82f878e8d1e8351706 100755 (executable)
@@ -124,8 +124,8 @@ test_expect_success 'check that appropriate filter is invoke when --path is used
        path0_sha=$(git hash-object --path=file0 file1) &&
        test "$file0_sha" = "$path0_sha" &&
        test "$file1_sha" = "$path1_sha" &&
-       path1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&
-       path0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&
+       path1_sha=$(git hash-object --path=file1 --stdin <file0) &&
+       path0_sha=$(git hash-object --path=file0 --stdin <file1) &&
        test "$file0_sha" = "$path0_sha" &&
        test "$file1_sha" = "$path1_sha"
 '
@@ -154,7 +154,7 @@ test_expect_success '--path works in a subdirectory' '
 test_expect_success 'check that --no-filters option works' '
        nofilters_file1=$(git hash-object --no-filters file1) &&
        test "$file0_sha" = "$nofilters_file1" &&
-       nofilters_file1=$(cat file1 | git hash-object --stdin) &&
+       nofilters_file1=$(git hash-object --stdin <file1) &&
        test "$file0_sha" = "$nofilters_file1"
 '
 
index e49b8024ac53659e17f22eb39e252aba73e56a6b..ab3a105ffff2532b35074611de9e65d60b8db082 100755 (executable)
@@ -968,7 +968,7 @@ test_expect_success 'check-rules non-cone mode' '
        git -C bare sparse-checkout check-rules --no-cone --rules-file ../rules\
                >check-rules-file <all-files &&
 
-       cat rules | git -C repo sparse-checkout set --no-cone --stdin &&
+       git -C repo sparse-checkout set --no-cone --stdin <rules &&
        git -C repo ls-files -t >out &&
        sed -n "/^S /!s/^. //p" out >ls-files &&