summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 08:24:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:00:15 (GMT)
commite61a509a497520550b5b84b753a95549158f9f1c (patch)
tree3b410cefcaa123f96a94ef7a0ed4008a9ec05cba /setup.c
parent7d0fb0da950026c08a88d8374be5716dafce72cc (diff)
downloadgit-e61a509a497520550b5b84b753a95549158f9f1c.zip
git-e61a509a497520550b5b84b753a95549158f9f1c.tar.gz
git-e61a509a497520550b5b84b753a95549158f9f1c.tar.bz2
setup.c: detect $GIT_COMMON_DIR check_repository_format_gently()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/setup.c b/setup.c
index 00a23e6..1d4f1aa 100644
--- a/setup.c
+++ b/setup.c
@@ -346,6 +346,10 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)
const char *repo_config;
int ret = 0;
+ get_common_dir(&sb, gitdir);
+ strbuf_addstr(&sb, "/config");
+ repo_config = sb.buf;
+
/*
* git_config() can't be used here because it calls git_pathdup()
* to get $GIT_CONFIG/config. That call will make setup_git_env()
@@ -355,8 +359,6 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)
* Use a gentler version of git_config() to check if this repo
* is a good one.
*/
- strbuf_addf(&sb, "%s/config", gitdir);
- repo_config = sb.buf;
git_config_early(check_repository_format_version, NULL, repo_config);
if (GIT_REPO_VERSION < repository_format_version) {
if (!nongit_ok)