diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-11-26 18:32:24 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-30 00:25:59 +0300 |
commit | 468d68226c6514a1c30390819da96c8a495c23d0 (patch) | |
tree | 97925eb7f6fd0a0d5160f88fe953fd69321a96f3 /t/t1510-repo-setup.sh | |
parent | 73a509ce44f94ad9a50126ab04490bce926feb8e (diff) |
t1510: setup case #25
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1510-repo-setup.sh')
-rwxr-xr-x | t/t1510-repo-setup.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 79959f6dc5..5be85eded3 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -3736,4 +3736,54 @@ EOF test_repo 24/sub ' +# +# case #25 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is set +# - GIT_DIR is not set +# - core.worktree is not set +# - .git is a file +# - core.bare is set +# +# Output: +# +# #17.2 except git_dir is set according to .git file + +test_expect_success '#25: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 25 25/sub && + cd 25 && + git init && + git config core.bare true && + GIT_WORK_TREE=non-existent && + export GIT_WORK_TREE && + mv .git ../25.git && + echo gitdir: ../25.git >.git && + cd .. +' + +test_expect_failure '#25: at root' ' + cat >25/expected <<EOF && +setup: git_dir: $TRASH_DIRECTORY/25.git +setup: worktree: (null) +setup: cwd: $TRASH_DIRECTORY/25 +setup: prefix: (null) +EOF + test_repo 25 +' + +test_expect_failure '#25: in subdir' ' + cat >25/sub/expected <<EOF && +setup: git_dir: $TRASH_DIRECTORY/25.git +setup: worktree: (null) +setup: cwd: $TRASH_DIRECTORY/25/sub +setup: prefix: (null) +EOF + test_repo 25/sub +' + test_done |