Re: [PATCH 09/22] t/t4*: avoid redundant uses of cat
- From
Beat Bolli <dev+git@drbeat.li>
- Date
- Mar 6, 2024, 20:58 UTC
- Message-ID
- <b7cfeb02-eab6-4822-921f-89a00a66e4b0@drbeat.li>
- In-Reply-To
- <CAPig+cQ13SANfReDNxVRPmS2TbK+0ZU4mT6g1rw9kWJHzH-j2w@mail.gmail.com>
On 06.03.24 02:08, Eric Sunshine wrote:
Show 20 quoted lines
> On Tue, Mar 5, 2024 at 4:31 PM Beat Bolli <bb@drbeat.li> wrote:
>> diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
>> @@ -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)
>> '
>
> Could also fix the style problem (drop whitespace after existing `<`
> operator) while here, but not at all worth a reroll.
>
>> diff --git a/t/t4150-am.sh b/t/t4150-am.sh
>> @@ -786,7 +786,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '
>> git checkout first &&
>> - cat pine patch1 | git am &&
>> + git am pine patch1 &&
>
> As with Junio, the semantic change made here concerned me.I was even more on the fence about this hunk than the others, but then the test was about 'am takes patches from a Pine mailbox', not specifically about reading a Pine mailbox from stdin. But I can drop this hunk in v2.
Cheers, Beat