diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-02-05 18:05:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-05 18:05:43 -0800 |
commit | f20408dadb75914460b9251b56fe4bffb5f44f48 (patch) | |
tree | 7241fcb8d3ec78b25c5504d2985caebef2965cbe /setup.c | |
parent | 141b6b83d7ca5bd32d55a0a7e08384084d081557 (diff) | |
parent | 72183cb297f614dc2df1c0ed08afac1be27ec35a (diff) | |
download | git-f20408dadb75914460b9251b56fe4bffb5f44f48.tar.gz |
Merge branch 'sg/maint-gitdir-in-subdir' into maint
* sg/maint-gitdir-in-subdir:
Fix gitdir detection when in subdir of gitdir
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; } |