From 9a5976cd389c1c0b31cb3f9b3d260c0d05521f4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 26 Nov 2010 22:32:07 +0700 Subject: [PATCH] t1510: setup case #8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t1510-repo-setup.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 8c6c0bca2c..9e9d5f163e 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -1137,4 +1137,51 @@ EOF test_repo 7/sub/sub "$TRASH_DIRECTORY/7/.git" "$TRASH_DIRECTORY" ' +# +# 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: +# +# #0 except that git_dir is set by .git file + +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 <