Thread (1 message) 1 message, 1 author, 2021-04-08

Re: [PATCH 6/9] t4013: add tests for log.diffMerges config

From: Sergey Organov <hidden>
Date: 2021-04-08 14:25:30

Ævar Arnfjörð Bjarmason [off-list ref] writes:
On Thu, Apr 08 2021, Sergey Organov wrote:
[...]
quoted
+test_expect_success 'deny wrong log.diffMerges config' '
+	git config log.diffMerges wrong-value &&
+	test_expect_code 128 git log &&
+	git config --unset log.diffMerges
Don't use "git config", but "test_config" at the start, then you don't
need the --unset at the end, it'll happen automatically. Ditto for the
following tests.
[...]

Junio C Hamano [off-list ref] writes:
Ævar Arnfjörð Bjarmason [off-list ref] writes:
quoted
quoted
+test_expect_success 'deny wrong log.diffMerges config' '
+	git config log.diffMerges wrong-value &&
+	test_expect_code 128 git log &&
+	git config --unset log.diffMerges
Don't use "git config", but "test_config" at the start, then you don't
need the --unset at the end, it'll happen automatically. Ditto for the
following tests.
More importantly, test_config arranges the unset to happen even if
a step in the middle (e.g. test_expect_code in the above example)
fails.  In the posted version, the control would not reach the
"git config --unset" and leaves the configuration behind.

And that is the biggest reason why the above should use test_config.
Yeah, thanks for pointing, – will fix for the next re-roll.

-- Sergey Organov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help