void read_early_config(config_fn_t cb, void *data)
{
struct config_options opts = {0};
- struct strbuf buf = STRBUF_INIT;
+ struct strbuf commondir = STRBUF_INIT;
+ struct strbuf gitdir = STRBUF_INIT;
opts.respect_includes = 1;
* notably, the current working directory is still the same after the
* call).
*/
- else if (discover_git_directory(&buf))
- opts.git_dir = buf.buf;
+ else if (!discover_git_directory(&commondir, &gitdir))
+ opts.git_dir = gitdir.buf;
git_config_with_options(cb, data, NULL, &opts);
- strbuf_release(&buf);
+ strbuf_release(&commondir);
+ strbuf_release(&gitdir);
}
static void git_config_check_init(void);