Fix an infinite loop in setup_git_directory_gently().

When a git command was invoked outside any git directory, it would not
terminate.
This commit is contained in:
Johannes Sixt
2007-08-20 16:36:58 +02:00
parent 942afeb88b
commit fce4254719

View File

@@ -302,7 +302,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
}
chdir("..");
do {
if (!offset) {
if (offset <= minoffset) {
if (nongit_ok) {
if (chdir(cwd))
die("Cannot come back to cwd");