diff options
author | Lars R. Damerow <lars@pixar.com> | 2010-03-17 12:55:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-28 09:19:11 -0700 |
commit | 502ffe3491bb6a3aff3f93e7eea19c01cf30c337 (patch) | |
tree | f6e983cec3e9c5716741b977364b9cb1e113e078 /setup.c | |
parent | 0ef37164c2e453e8348fee05e50d3a4ed6d69f6b (diff) | |
download | git-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |