From: Nguyễn Thái Ngọc Duy Date: Fri, 26 Nov 2010 15:32:15 +0000 (+0700) Subject: t1510: setup case #16 X-Git-Tag: v1.7.4-rc0~4^2~28 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=af62cc1ba686dd94f5c0ca4181db00e1b8519af8;p=git.git t1510: setup case #16 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 25f7c015e..2596f7ff7 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -2225,4 +2225,139 @@ EOF test_repo 15/sub/sub "$TRASH_DIRECTORY/15/.git" "$TRASH_DIRECTORY" ' +# +# case #16.1 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is not set +# - core.worktree is not set +# - .git is a directory +# - cwd is inside .git +# +# Output: +# +# - no worktree +# - cwd is unchanged +# - prefix is NULL +# - git_dir is set +# - cwd can't be outside worktree + +test_expect_success '#16.1: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 16 16/sub && + cd 16 && + git init && + mkdir .git/wt .git/wt/sub && + cd .. +' + +test_expect_success '#16.1: at .git' ' + cat >16/.git/expected <16/.git/wt/expected <16/.git/wt/sub/expected <16/.git/expected <16/.git/wt/expected <16/.git/wt/sub/expected <16/expected <16/sub/expected <