Code

repo-config: Fix late-night bug
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Tue, 20 Jun 2006 07:45:53 +0000 (09:45 +0200)
committerJunio C Hamano <junkio@cox.net>
Tue, 20 Jun 2006 08:21:51 +0000 (01:21 -0700)
This bug was hidden by the "future-proofing" of the test. Sigh.

When neither GIT_CONFIG nor GIT_CONFIG_LOCAL is set, do not use NULL,
but $GIT_DIR/config. Instead of using $GIT_DIR/config when only
GIT_CONFIG_LOCAL is set. Sorry.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
repo-config.c

index 03f108fe2f8a624075e7e7db4177df13dc38372f..ab8f1afeea0cbff7707e313af1c18ff56363ae09 100644 (file)
@@ -74,8 +74,6 @@ static int get_value(const char* key_, const char* regex_)
                const char *home = getenv("HOME");
                local = getenv("GIT_CONFIG_LOCAL");
                if (!local)
-                       local = repo_config;
-               else
                        local = repo_config = strdup(git_path("config"));
                if (home)
                        global = strdup(mkpath("%s/.gitconfig", home));