From: Nguyễn Thái Ngọc Duy Date: Fri, 26 Nov 2010 15:32:01 +0000 (+0700) Subject: t1510: setup case #2 X-Git-Tag: v1.7.4-rc0~4^2~42 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7194660205c39b39badcf555eb76200a80295814;p=git.git t1510: setup case #2 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 9324d3ff6..74750b8d4 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 <