Re: [PATCH v2 2/2] bundle tests: use test_cmp instead of grep

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

 



On Thu, Jul 22, 2021 at 01:53:29AM +0200, Ævar Arnfjörð Bjarmason wrote:
> Change the bundle tests to fully compare the expected "git ls-remote"
> or "git bundle list-heads" output, instead of merely grepping it.

Thanks; this version makes all of those tests more readable. I did have
one idle thought while reading, but what you wrote is right (so I'm just
thinking out loud as opposed to anything else).

> -	sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary &&
> -	grep "^-$OID_REGEX " boundary
> +
> +	if ! test_have_prereq SHA1
> +	then
> +		echo "@object-format=sha256"
> +	fi >expect &&
> +	cat >>expect <<-EOF &&

On my first read, I worried that this 'cat >>expect' when we're in
SHA-1 mode would append to the 'expect' we generated a few lines up. But
it doesn't, since we redirect the output of the 'if' statement into
'expect' instead of doing the redirect attached to the echo.

Subtle, but that's right. Good.

Thanks,
Taylor



[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