From 92a28be0ce12a50e0e53268be99130c2ef504c7e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 20 Jun 2006 09:45:53 +0200 Subject: [PATCH 1/2] repo-config: Fix late-night bug 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 Signed-off-by: Junio C Hamano --- repo-config.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/repo-config.c b/repo-config.c index 03f108fe2f..ab8f1afeea 100644 --- a/repo-config.c +++ b/repo-config.c @@ -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)); From e33d0611c0dd438ed9c1960518540c707201707a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 20 Jun 2006 09:51:09 +0200 Subject: [PATCH 2/2] git_config: access() returns 0 on success, not > 0 Another late-night bug. Sorry again. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.c b/config.c index d064f429cb..3e077d4c6c 100644 --- a/config.c +++ b/config.c @@ -335,7 +335,7 @@ int git_config(config_fn_t fn) if (home) { char *user_config = strdup(mkpath("%s/.gitconfig", home)); - if (access(user_config, R_OK) > 0) + if (!access(user_config, R_OK)) ret = git_config_from_file(fn, user_config); free(user_config); }