Re: [PATCH 2/2] fetch: do not override partial clone filter
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 22, 2020, 15:51 UTC
- Message-ID
- <xmqqk0wllshb.fsf@gitster.c.googlers.com>
- In-Reply-To
- <b59f00b6-2787-261e-a295-35eb4a6f442b@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 13 quoted lines
> On 9/22/2020 1:46 AM, Junio C Hamano wrote: >> Jonathan Tan <jonathantanmy@google.com> 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.