From: Nguyễn Thái Ngọc Duy Date: Sun, 24 Oct 2010 12:11:43 GMT Subject: [WIP PATCH 11/18] t1510: setup case #8 Message-ID: <1287922310-14678-12-git-send-email-pclouds@gmail.com> In-Reply-To: <1287922310-14678-1-git-send-email-pclouds@gmail.com> --- t/t1510-repo-setup.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 2f36bfe..c77c245 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -1263,4 +1263,56 @@ EOF GIT_DIR="$TRASH_DIRECTORY/7/.git" GIT_WORK_TREE="$TRASH_DIRECTORY" test_repo 7/sub/sub ' +# +# case #8 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is not set +# - core.worktree is not set +# - .git is a file +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# same as case #1 except that git_dir is set by .git file +# +# - worktree is at .git file's parent directory +# - cwd is at worktree root +# - prefix is calculated +# - git_dir is set to where .git points to +# - cwd can't be outside worktree + +test_expect_success '#8: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 8 8/sub && + cd 8 && + git init && + mv .git ../8.git && + echo gitdir: ../8.git >.git && + cd .. +' + +test_expect_success '#8: at root' ' + cat >8/expected <8/sub/expected <