X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=setup.c;h=dfda532adc16f5e6d25d7cfc5add3e0e2b6a5209;hb=5d680a67d7909c89af96eba4a2d77abed606292b;hp=6b277b6a11d3d8419d79a93628b9923001a065a6;hpb=8f8b8873a9f4e205eff9114e2679a887c38bf27a;p=git.git diff --git a/setup.c b/setup.c index 6b277b6a1..dfda532ad 100644 --- a/setup.c +++ b/setup.c @@ -456,7 +456,11 @@ const char *setup_git_directory_gently(int *nongit_ok) inside_git_dir = 1; if (!work_tree_env) inside_work_tree = 0; - setenv(GIT_DIR_ENVIRONMENT, ".", 1); + if (offset != len) { + cwd[offset] = '\0'; + setenv(GIT_DIR_ENVIRONMENT, cwd, 1); + } else + setenv(GIT_DIR_ENVIRONMENT, ".", 1); check_repository_format_gently(nongit_ok); return NULL; }