From: Nguyễn Thái Ngọc Duy Date: Fri, 26 Nov 2010 15:32:01 GMT Subject: [PATCH 05/47] t1510: setup case #2 Message-ID: <1290785563-15339-6-git-send-email-pclouds@gmail.com> In-Reply-To: <1290785563-15339-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t1510-repo-setup.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 4e9c425..febf9c4 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -152,4 +152,71 @@ EOF 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 <