Re: [PATCH 2/2] fetch: do not override partial clone filter

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

 



Derrick Stolee <stolee@xxxxxxxxx> writes:

> On 9/22/2020 1:46 AM, Junio C Hamano wrote:
>> Jonathan Tan <jonathantanmy@xxxxxxxxxx> writes:
>> 
>>> +test_expect_success 'ensure that filter is written to config' '
>>> +	FILTER=$(git -C client config --get remote.blah.partialclonefilter) &&
>>> +	test "$FILTER" == "blob:limit=0"
>> 
>> I'll do s/==/=/ locally because otherwise the test-lint-shell-syntax
>> will choke on this line.  No need to resend only this line.
>
> Wouldn't "test_cmp_config" be a better here? It seems like
> this is testing the "git clone" behavior of the previous test,
> so it could be added to that test instead.

TIL that one ;-) "git config --get" gives only a single instance,
but in this particular case, shouldn't we be verifying not just that
the expected one is found, but it is the only one, with "--get-all"?

FWIW, many uses of that test helper may want to be tightened the
same way.  In short, unless we are testing the last-one-wins
behaviour, and especially when we are interested in what changes our
tested operation makes to the config file's contents, we should be
using "--get-all" instead of the default "--get", I suspect.

Thanks.



[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