]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t4*: avoid redundant uses of cat
authorBeat Bolli <bb@drbeat.li>
Fri, 15 Mar 2024 19:46:06 +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/t4020-diff-external.sh
t/t4205-log-pretty-formats.sh
t/t4301-merge-tree-write-tree.sh

index c1ac09ecc7140a3dcfcdf906bb4533ba131881de..fdd865f7c38dea5b60910b46c2a113ec7f5c2a09 100755 (executable)
@@ -232,7 +232,7 @@ keep_only_cr () {
 test_expect_success 'external diff with autocrlf = true' '
        test_config core.autocrlf true &&
        GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&
-       test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)
+       test $(wc -l <crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)
 '
 
 test_expect_success 'diff --cached' '
index e3d655e6b8b5565d619298b16da010ee671667a2..1409eebcd8557f20de38fee9c4a6166a959056b9 100755 (executable)
@@ -156,7 +156,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' '
        for r in $revs
        do
                git show -s --pretty=oneline "$r" >raw &&
-               cat raw | lf_to_nul || return 1
+               lf_to_nul <raw || return 1
        done >expect &&
        # the trailing NUL is already produced so we do not need to
        # output another one
index 29e9974cdfd421f6fb7dd17fa2bb12db8d5d6e04..eea19907b550c4a97a7ca7760f1be30bea7d8db0 100755 (executable)
@@ -313,7 +313,7 @@ test_expect_success 'rename/add handling' '
                # First, check that the bar that appears at stage 3 does not
                # correspond to an individual blob anywhere in history
                #
-               hash=$(cat out | tr "\0" "\n" | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
+               hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
                git rev-list --objects --all >all_blobs &&
                ! grep $hash all_blobs &&
 
@@ -380,7 +380,7 @@ test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' '
                # First, check that the bar that appears at stage 3 does not
                # correspond to an individual blob anywhere in history
                #
-               hash=$(cat out | tr "\0" "\n" | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
+               hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
                git rev-list --objects --all >all_blobs &&
                ! grep $hash all_blobs &&
 
@@ -630,8 +630,8 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi
                # conflict entries do not appear as individual blobs anywhere
                # in history.
                #
-               hash1=$(cat out | tr "\0" "\n" | head | grep 2.four | cut -f 2 -d " ") &&
-               hash2=$(cat out | tr "\0" "\n" | head | grep 3.two | cut -f 2 -d " ") &&
+               hash1=$(tr "\0" "\n" <out | head | grep 2.four | cut -f 2 -d " ") &&
+               hash2=$(tr "\0" "\n" <out | head | grep 3.two | cut -f 2 -d " ") &&
                git rev-list --objects --all >all_blobs &&
                ! grep $hash1 all_blobs &&
                ! grep $hash2 all_blobs &&