t/t3*: 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 2b5a303ad8da78eeb53bdb1debc2a911173a51b2
3 files changed +6 -6
t/t3200-branch.sh
+1 -1
@@ -576,7 +576,7 @@ EOF
576
577 # ...and that the comments for those sections are also
578 # preserved.
579 - cat config.branch | sed "s/\"source\"/\"dest\"/" >expect &&
579 + sed "s/\"source\"/\"dest\"/" config.branch >expect &&
580 sed -n -e "/Note the lack/,\$p" .git/config >actual &&
581 test_cmp expect actual
582 '
t/t3321-notes-stripspace.sh
+4 -4
@@ -442,7 +442,7 @@ test_expect_success 'add note by specifying "-C", "--no-stripspace" is the defau
442 ${LF}
443 EOF
444
445 - cat expect | git hash-object -w --stdin >blob &&
445 + git hash-object -w --stdin <expect >blob &&
446 git notes add -C $(cat blob) &&
447 git notes show >actual &&
448 test_cmp expect actual &&
@@ -468,7 +468,7 @@ test_expect_success 'reuse note by specifying "-C" and "--stripspace"' '
468 second-line
469 EOF
470
471 - cat data | git hash-object -w --stdin >blob &&
471 + git hash-object -w --stdin <data >blob &&
472 git notes add --stripspace -C $(cat blob) &&
473 git notes show >actual &&
474 test_cmp expect actual
@@ -492,7 +492,7 @@ test_expect_success 'reuse with "-C" and add note with "-m", "-m" will stripspac
492 third-line
493 EOF
494
495 - cat data | git hash-object -w --stdin >blob &&
495 + git hash-object -w --stdin <data >blob &&
496 git notes add -C $(cat blob) -m "third-line" &&
497 git notes show >actual &&
498 test_cmp expect actual
@@ -511,7 +511,7 @@ test_expect_success 'add note with "-m" and reuse note with "-C", "-C" will not
511 second-line
512 EOF
513
514 - cat data | git hash-object -w --stdin >blob &&
514 + git hash-object -w --stdin <data >blob &&
515 git notes add -m "first-line" -C $(cat blob) &&
516 git notes show >actual &&
517 test_cmp expect actual
t/t3920-crlf-messages.sh
+1 -1
@@ -10,7 +10,7 @@ LIB_CRLF_BRANCHES=""
10 create_crlf_ref () {
11 branch="$1" &&
12 cat >.crlf-orig-$branch.txt &&
13 - cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&
13 + append_cr <.crlf-orig-$branch.txt >.crlf-message-$branch.txt &&
14 grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
15 grep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt &&
16 LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&