diff options
author | Beat Bolli <bb@drbeat.li> | 2024-03-15 20:46:05 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-16 11:08:56 -0700 |
commit | 2b5a303ad8da78eeb53bdb1debc2a911173a51b2 (patch) | |
tree | 9d81015262f2ced7f045396a818b338f6c9fa242 | |
parent | 2ed139ccc935f9bacc670e7be32694657918e84d (diff) | |
download | git-2b5a303ad8da78eeb53bdb1debc2a911173a51b2.tar.gz |
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>
-rwxr-xr-x | t/t3200-branch.sh | 2 | ||||
-rwxr-xr-x | t/t3321-notes-stripspace.sh | 8 | ||||
-rwxr-xr-x | t/t3920-crlf-messages.sh | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 33aba87b9a..d3bbd00b81 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -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 ' diff --git a/t/t3321-notes-stripspace.sh b/t/t3321-notes-stripspace.sh index 088a852dd4..beca346056 100755 --- a/t/t3321-notes-stripspace.sh +++ b/t/t3321-notes-stripspace.sh @@ -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 diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index 67fd2345af..5eed640a68 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -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}" && |