aboutsummaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index c14b10636..045ca20b3 100644
--- a/setup.c
+++ b/setup.c
@@ -446,7 +446,6 @@ const char *setup_git_directory_gently(int *nongit_ok)
check_repository_format_gently(nongit_ok);
return NULL;
}
- chdir("..");
while (--offset > ceil_offset && cwd[offset] != '/');
if (offset <= ceil_offset) {
if (nongit_ok) {
@@ -457,6 +456,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
}
die("Not a git repository");
}
+ chdir("..");
}
inside_git_dir = 0;