summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2007-11-03 13:18:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-04 04:47:13 (GMT)
commit1e8a1954519a070e92cb73f756b271664e1cc4d1 (patch)
tree0e9ee649c9fbbb232b904f6f8f8071feadc37e68 /setup.c
parentee787400de25ed419f40e70698ba35db475b2d61 (diff)
downloadgit-1e8a1954519a070e92cb73f756b271664e1cc4d1.zip
git-1e8a1954519a070e92cb73f756b271664e1cc4d1.tar.gz
git-1e8a1954519a070e92cb73f756b271664e1cc4d1.tar.bz2
Add missing inside_work_tree setting in setup_git_directory_gently
When both GIT_DIR and GIT_WORK_TREE are set, and setup_git_directory_gently() changes the current working directory accordingly, it should also set inside_work_tree = 1. Without this, work_tree handling code in setup_git_directory() will be activated. If you stay in root work tree (no prefix), it does not harm. It does if you work from a subdirectory though. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index 145eca5..6f8f769 100644
--- a/setup.c
+++ b/setup.c
@@ -240,6 +240,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
if (chdir(work_tree_env) < 0)
die ("Could not chdir to %s", work_tree_env);
strcat(buffer, "/");
+ inside_work_tree = 1;
return retval;
}
if (nongit_ok) {