From e6aea2dba27798f5d1eca32435e407541caca400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 26 Nov 2010 22:32:35 +0700 Subject: setup: limit get_git_work_tree()'s to explicit setup case only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_git_work_tree() takes input as core.worktree, core.bare, GIT_WORK_TREE and decides correct worktree setting. Unfortunately it does not do its job well. core.worktree and GIT_WORK_TREE should only be taken into account, if GIT_DIR is set (which is handled by setup_explicit_git_dir). For other setup cases, only core.bare matters. Add a temporary variable setup_explicit to adjust get_git_work_tree() behavior as such. This variable will be gone once setup_* rework is done. Also remove is_bare_repository_cfg check in set_git_work_tree() to ease the rework. We are going to check for core.bare and core.worktree early before setting worktree. For example, if core.bare is true, no need to set worktree. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t1510-repo-setup.sh | 66 +++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 't') diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index fbab9c7e68..a5f10a5878 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -132,7 +132,7 @@ test_expect_success '#1: setup' ' cd .. ' -test_expect_failure '#1: at root' ' +test_expect_success '#1: at root' ' cat >1/expected <1/sub/expected <4/expected <4/sub/expected <5/expected <5/sub/expected <9/expected <9/sub/expected <12/expected <12/sub/expected <13/expected <13/sub/expected <17/.git/expected <17/.git/wt/expected <17/.git/wt/sub/expected <17/.git/expected <17/.git/wt/expected <17/.git/wt/sub/expected <17/expected <20/.git/expected <20/.git/wt/expected <20/.git/wt/sub/expected <21/.git/expected <21/.git/wt/expected <21/.git/wt/sub/expected <21/.git/expected <21/.git/wt/expected <21/.git/wt/sub/expected <21/expected <24/expected <24/sub/expected <28/expected <28/sub/expected <