Re: [PATCH v2] tests: modernize the test script t0010-racy-git.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> On Thu, Feb 29, 2024 at 6:14 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> So, we may want to do it more like this, perhaps?
>>
>>         test_expect_success "Racy GIT trial #$trial part A" '
>>                 rm -f .git/index &&
>>                 echo frotz >infocom &&
>>                 git update-index --add infocom &&
>>                 echo xyzzy >infocom &&
>>
>>                 files=$(git diff-files -p) &&
>>                 test "" != "$files"
>>         '
>
> If taking it to this extent, then the modernized version of the last
> couple lines would be:
>
>     git diff-files -p >out &&
>     test_file_not_empty out

Yes.  The modern style seems to prefer temporary files over
variables; the reason probably is because it tends to be easier to
remotely post-mortem?





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux