diff options
author | David Reiss <dreiss@facebook.com> | 2008-05-19 23:49:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-23 14:15:01 -0700 |
commit | 450f437fb0fe276a6e946c281c768118e39dc9e7 (patch) | |
tree | 7e4e2dc2293a7d385805ca3110bc62396ba7b224 /setup.c | |
parent | 0454dd93bfb2334355ec62fff670d8c6cb3570a1 (diff) | |
download | git-450f437fb0fe276a6e946c281c768118e39dc9e7.tar.gz git-450f437fb0fe276a6e946c281c768118e39dc9e7.tar.xz |
Eliminate an unnecessary chdir("..")
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>
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |