Fix global repository field not being cleared (#4083)

It is checked for w.r.t. global repository struct down in the callstack
in compatibility layer for MinGW before being assigned in the function
that `free()`'d it.
This commit is contained in:
Johannes Schindelin 2022-12-20 15:13:55 +01:00
commit 240fa13ae4

View File

@ -136,7 +136,7 @@ static void repo_set_commondir(struct repository *repo,
{
struct strbuf sb = STRBUF_INIT;
free(repo->commondir);
FREE_AND_NULL(repo->commondir);
if (commondir) {
repo->different_commondir = 1;