Skip to content

Commit 41e95f6

Browse files
matledJunio C Hamano
authored andcommitted
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>
1 parent ca7a741 commit 41e95f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

setup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
184184
}
185185
return NULL;
186186
bad_dir_environ:
187+
if (!nongit_ok) {
188+
*nongit_ok = 1;
189+
return NULL;
190+
}
187191
path[len] = 0;
188192
die("Not a git repository: '%s'", path);
189193
}

0 commit comments

Comments
 (0)