diff --git a/compat/mingw.c b/compat/mingw.c index d4b265ee62..5b4c370e07 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -7,6 +7,7 @@ #include "../run-command.h" #include "../cache.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 981482ec28..d22732865a 100644 --- a/config.c +++ b/config.c @@ -1536,6 +1536,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;