Re: [PATCH 1/3] fsck: verify commit graph when implicitly enabled
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 13, 2021, 19:33 UTC
- Message-ID
- <CAPig+cRbSUaahdRr9pj9==_7g0Om-Zax93zBRBiJg0-X7zXnOA@mail.gmail.com>
- In-Reply-To
- <YT+mlW851sRyt842@nand.local>
On Mon, Sep 13, 2021 at 3:29 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 12 quoted lines
> On Mon, Sep 13, 2021 at 11:12:19AM -0700, Glen Choo wrote: > > +test_expect_success 'git fsck (ignores commit-graph when config set to false)' ' > > + cd "$TRASH_DIRECTORY/full" && > > + git fsck && > > + corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \ > > + "incorrect checksum" && > > + cp commit-graph-pre-write-test $objdir/info/commit-graph && > > + git -c core.commitGraph=false fsck > > Nit; I recommend replacing the `-c` style configuration with > `test_config`, which modifies `$GIT_DIR/config` but only for the > duration of the sub-shell.
Small correction: There is no subshell here, so it would be more accurate to say "... for the duration of the test".
Aside: In fact, test_config() can't be used in subshells due to implementation limitations which I won't go into.