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>
This commit is contained in:
parent
ca7a741647
commit
41e95f6990
4
setup.c
4
setup.c
@ -184,6 +184,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
bad_dir_environ:
|
bad_dir_environ:
|
||||||
|
if (!nongit_ok) {
|
||||||
|
*nongit_ok = 1;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
path[len] = 0;
|
path[len] = 0;
|
||||||
die("Not a git repository: '%s'", path);
|
die("Not a git repository: '%s'", path);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user