@matheusbsbs / matheus-bagliano / commits / 1e8a195451
Fork 0

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>

Nguyễn Thái Ngọc Duy committed Nov 3, 2007 at 20:18 UTC 1e8a1954519a070e92cb73f756b271664e1cc4d1
1 file changed +1
setup.c
+1
@@ -240,6 +240,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
240 if (chdir(work_tree_env) < 0)
241 die ("Could not chdir to %s", work_tree_env);
242 strcat(buffer, "/");
243 + inside_work_tree = 1;
244 return retval;
245 }
246 if (nongit_ok) {