From: Matthias Lederhofer Date: Sun, 30 Jul 2006 01:30:29 +0000 (+0200) Subject: setup_git_directory_gently: do not barf when GIT_DIR is given. X-Git-Tag: v1.4.2-rc3~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=41e95f699088b14c6a949ec858499f98df4f34f6;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/setup.c b/setup.c index 4612f110e..358e139d8 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); }