On Mon, Sep 13, 2021 at 7:19 PM Glen Choo <chooglen@xxxxxxxxxx> wrote: > On Mon, Sep 13, 2021 at 03:29:25PM -0400, Taylor Blau wrote: > > > + git config --unset core.commitGraph && > > > > But I'm not aware of a way to temporarily unset a configuration variable > > for the duration of a test, so here I would probably write: > > > > test_must_fail git -c core.commitGraph= fsck > > > > which Git interprets as "pretend this variable is unset in-core". > > From my testing, I suspect that git does not pretend the variable is > unset, but rather, it pretends that the variable is set to the empty > string. It seems that git behaves as if the variable is set to "false". > This is called out in Documentation/git.txt: > > Including the equals but with an empty value (like `git -c > foo.bar= ...`) sets `foo.bar` to the empty string which `git config > --type=bool` will convert to `false`. > > If the variable really is set to false, how might we proceed here? Shall > we stick with test_when_finished? That's probably reasonable, however, for robustness, you should probably use test_unconfig() rather than raw `git config --unset` to clear the variable. Aside: This certainly makes one wonder if we should have a new function in t/test-lib-functions.sh which unsets a variable for the duration of a test only. However, that's outside the scope of this submission.