In the case where setup_git_directory_gently fails, avoid the last
chdir("..") by moving it after the ceil_offset check.
Signed-off-by: David Reiss <dreiss@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
check_repository_format_gently(nongit_ok);
return NULL;
}
- chdir("..");
while (--offset > ceil_offset && cwd[offset] != '/');
if (offset <= ceil_offset) {
if (nongit_ok) {
}
die("Not a git repository");
}
+ chdir("..");
}
inside_git_dir = 0;