summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorMatthias Lederhofer <matled@gmx.net>2006-07-30 01:30:29 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-07-31 00:45:57 (GMT)
commit41e95f699088b14c6a949ec858499f98df4f34f6 (patch)
treeb382b097b0c5f77551cb2470db3198f614317ce5 /setup.c
parentca7a741647f961eb3b6b9df14d079c99fdc9a827 (diff)
downloadgit-41e95f699088b14c6a949ec858499f98df4f34f6.zip
git-41e95f699088b14c6a949ec858499f98df4f34f6.tar.gz
git-41e95f699088b14c6a949ec858499f98df4f34f6.tar.bz2
setup_git_directory_gently: do not barf when GIT_DIR is given.
Earlier we barfed when GIT_DIR environment variable points at a directory yet to be created, which made it impossible to use configuration mechanism in "git-init-db". Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index 4612f11..358e139 100644
--- a/setup.c
+++ b/setup.c
@@ -184,6 +184,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
}
return NULL;
bad_dir_environ:
+ if (!nongit_ok) {
+ *nongit_ok = 1;
+ return NULL;
+ }
path[len] = 0;
die("Not a git repository: '%s'", path);
}