Re: [PATCH 08/16] t/t5516-fetch-push: use test_config()
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jun 22, 2013, 09:57 UTC
- Message-ID
- <51C57527.8060806@kdbg.org>
- In-Reply-To
- <7vobazjdrf.fsf@alter.siamese.dyndns.org>
Am 22.06.2013 00:32, schrieb Junio C Hamano:
Show 22 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes: > >> Replace the 'git config' calls in tests with test_config for greater >> robustness. > > That may be a good thing in principle, but I _think_ > > mk_empty testrepo && > ( > cd testrepo && > do whatever to its config && > run test > ) > > sequence is used so that we do not even have to worry about what > leftover configuration values are in the testrepo/.git/config; so > does it really matter? > > If this conversion had something more than "s/git config/test_config/" > replacement, that would indicate that you uncovered a bug in the > existing test and found a good fix, but that does not seem to be the > case for this particular patch.
And just let me add that the added benefit of test_config to remove the configuration change after the test case finished would not work because the test_when_finished registration that happens behind the scenes would be forgotten when the sub-shell exits.
Show 9 quoted lines
>> @@ -142,8 +142,8 @@ test_expect_success 'fetch with wildcard' ' >> mk_empty testrepo && >> ( >> cd testrepo && >> - git config remote.up.url .. && >> - git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" && >> + test_config remote.up.url .. && >> + test_config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" && >> git fetch up &&
...
-- Hannes