]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t3*: avoid redundant uses of cat
authorBeat Bolli <bb@drbeat.li>
Fri, 15 Mar 2024 19:46:05 +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/t3200-branch.sh
t/t3321-notes-stripspace.sh
t/t3920-crlf-messages.sh

index 33aba87b9a4db314880a640b7ae65d7ba9c76a06..d3bbd00b818a4f26e2c19ae0ec432138200afc62 100755 (executable)
@@ -576,7 +576,7 @@ EOF
 
        # ...and that the comments for those sections are also
        # preserved.
-       cat config.branch | sed "s/\"source\"/\"dest\"/" >expect &&
+       sed "s/\"source\"/\"dest\"/" config.branch >expect &&
        sed -n -e "/Note the lack/,\$p" .git/config >actual &&
        test_cmp expect actual
 '
index 088a852dd47aa335d83424f21472f8384c91cf16..beca34605672d407244b26ebcffb1f70527f5915 100755 (executable)
@@ -442,7 +442,7 @@ test_expect_success 'add note by specifying "-C", "--no-stripspace" is the defau
        ${LF}
        EOF
 
-       cat expect | git hash-object -w --stdin >blob &&
+       git hash-object -w --stdin <expect >blob &&
        git notes add -C $(cat blob) &&
        git notes show >actual &&
        test_cmp expect actual &&
@@ -468,7 +468,7 @@ test_expect_success 'reuse note by specifying "-C" and "--stripspace"' '
        second-line
        EOF
 
-       cat data | git hash-object -w --stdin >blob &&
+       git hash-object -w --stdin <data >blob &&
        git notes add --stripspace -C $(cat blob) &&
        git notes show >actual &&
        test_cmp expect actual
@@ -492,7 +492,7 @@ test_expect_success 'reuse with "-C" and add note with "-m", "-m" will stripspac
        third-line
        EOF
 
-       cat data | git hash-object -w --stdin >blob &&
+       git hash-object -w --stdin <data >blob &&
        git notes add -C $(cat blob) -m "third-line" &&
        git notes show >actual &&
        test_cmp expect actual
@@ -511,7 +511,7 @@ test_expect_success 'add note with "-m" and reuse note with "-C", "-C" will not
        second-line
        EOF
 
-       cat data | git hash-object -w --stdin >blob &&
+       git hash-object -w --stdin <data >blob &&
        git notes add -m "first-line" -C $(cat blob)  &&
        git notes show >actual &&
        test_cmp expect actual
index 67fd2345affd78507a6cb714b48565ed190cb5af..5eed640a6825dd4522e5c68d12364768a06d9c3b 100755 (executable)
@@ -10,7 +10,7 @@ LIB_CRLF_BRANCHES=""
 create_crlf_ref () {
        branch="$1" &&
        cat >.crlf-orig-$branch.txt &&
-       cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&
+       append_cr <.crlf-orig-$branch.txt >.crlf-message-$branch.txt &&
        grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
        grep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt &&
        LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&