From: Nguyễn Thái Ngọc Duy Date: Wed, 27 Oct 2010 14:49:22 GMT Subject: [PATCH 19/34] t1510: setup case #16 Message-ID: <1288190977-30875-20-git-send-email-pclouds@gmail.com> In-Reply-To: <1288190977-30875-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t1510-repo-setup.sh | 135 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 135 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 47c8814..a856d7c 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -2218,4 +2218,139 @@ EOF GIT_DIR="$TRASH_DIRECTORY/15/.git" GIT_WORK_TREE="$TRASH_DIRECTORY" test_repo 15/sub/sub ' +# +# 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 <