aboutsummaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorLars R. Damerow <lars@pixar.com>2010-03-17 12:55:52 -0700
committerJunio C Hamano <gitster@pobox.com>2010-03-28 09:19:11 -0700
commit502ffe3491bb6a3aff3f93e7eea19c01cf30c337 (patch)
treef6e983cec3e9c5716741b977364b9cb1e113e078 /setup.c
parent0ef37164c2e453e8348fee05e50d3a4ed6d69f6b (diff)
downloadgit-502ffe3491bb6a3aff3f93e7eea19c01cf30c337.tar.gz
git-502ffe3491bb6a3aff3f93e7eea19c01cf30c337.tar.xz
truncate cwd string before printing error message
Without this truncation the error message printed only shows the cwd from the start of the search, not where it failed. Signed-off-by: Lars R. Damerow <lars@pixar.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 5716d90b5..f0b56b9f5 100644
--- a/setup.c
+++ b/setup.c
@@ -422,8 +422,10 @@ const char *setup_git_directory_gently(int *nongit_ok)
}
die("Not a git repository (or any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
}
- if (chdir(".."))
+ if (chdir("..")) {
+ cwd[offset] = '\0';
die_errno("Cannot change to '%s/..'", cwd);
+ }
}
inside_git_dir = 0;