From: Nguyễn Thái Ngọc Duy Date: Fri, 29 Oct 2010 06:48:25 GMT Subject: [PATCH 13/42] t1510: setup case #10 Message-ID: <1288334934-17216-14-git-send-email-pclouds@gmail.com> In-Reply-To: <1288334934-17216-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 aea63ed..a680f4e 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -1227,4 +1227,71 @@ EOF GIT_WORK_TREE=non-existent test_repo 9/sub ' +# +# case #10 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is set +# - core.worktree is not set +# - .git is a file +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# #2 except that git_dir is set by .git file + +test_expect_success '#10: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 10 10/sub && + cd 10 && + git init && + mv .git ../10.git && + echo gitdir: ../10.git >.git && + cd .. +' + +test_expect_failure '#10: at root' ' + cat >10/expected <10/sub/expected <10/expected <10/sub/expected <