From: Lars R. Damerow Date: Wed, 17 Mar 2010 19:55:52 +0000 (-0700) Subject: truncate cwd string before printing error message X-Git-Tag: v1.7.2-rc0~129^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=502ffe3491bb6a3aff3f93e7eea19c01cf30c337;p=git.git 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 Signed-off-by: Junio C Hamano --- 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;