From: Nguyễn Thái Ngọc Duy Date: Sun, 24 Oct 2010 12:11:37 GMT Subject: [WIP PATCH 05/18] t1510: setup case #2 Message-ID: <1287922310-14678-6-git-send-email-pclouds@gmail.com> In-Reply-To: <1287922310-14678-1-git-send-email-pclouds@gmail.com> --- t/t1510-repo-setup.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index d450b4a..20ad6d4 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -139,4 +139,67 @@ EOF GIT_WORK_TREE=non-existent test_repo 1/sub ' +# +# case #2 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is set +# - core.worktree is not set +# - .git is a directory +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# - worktree is at original cwd +# - cwd is unchanged +# - prefix is NULL +# - git_dir is set to $GIT_DIR +# - cwd can't be outside worktree + +test_expect_success '#2: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 2 2/sub && + cd 2 && git init && cd .. +' + +test_expect_success '#2: at root' ' + cat >2/expected <2/sub/expected <2/expected <2/sub/expected <