From: Nguyễn Thái Ngọc Duy Date: Wed, 27 Oct 2010 14:49:06 GMT Subject: [PATCH 03/34] t1510: setup case #0 Message-ID: <1288190977-30875-4-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 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 47 insertions(+), 0 deletions(-) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 218eb35..d94a2d6 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -56,4 +56,51 @@ test_repo() { # Bit 4 = bare repo # Case# = encoding of the above 5 bits +# +# Case #0 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is not set +# - core.worktree is not set +# - .git is a directory +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# - worktree is .git's parent directory +# - cwd is at worktree root dir +# - prefix is calculated +# - git_dir is set to ".git" +# - cwd can't be outside worktree + +test_expect_success '#0: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 0 0/sub && + cd 0 && git init && cd .. +' + +test_expect_success '#0: at root' ' + cat >0/expected <0/sub/expected <