diff --git a/compat/mingw.c b/compat/mingw.c index e07ec981d1..2526e0c5b1 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -8,6 +8,7 @@ #include "../cache.h" #include "win32/lazyload.h" #include "win32/exit-process.h" +#include "../config.h" #define HCAST(type, handle) ((type)(intptr_t)handle) diff --git a/config.c b/config.c index 99dd8e02ca..adcd2c2441 100644 --- a/config.c +++ b/config.c @@ -1532,6 +1532,8 @@ static int do_git_config_sequence(const struct config_options *opts, if (opts->commondir) repo_config = mkpathdup("%s/config", opts->commondir); + else if (opts->git_dir) + repo_config = mkpathdup("%s/config", opts->git_dir); else repo_config = NULL;