From 1e8a1954519a070e92cb73f756b271664e1cc4d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 3 Nov 2007 20:18:06 +0700 Subject: [PATCH] Add missing inside_work_tree setting in setup_git_directory_gently MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- setup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.c b/setup.c index 145eca50f..6f8f76958 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) { -- 2.30.2