[PATCH 07/34] t1510: setup case #4
From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 22:49:55
Subsystem:
the rest · Maintainer:
Linus Torvalds
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- t/t1510-repo-setup.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index e1b8958..6617792 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh@@ -483,4 +483,50 @@ EOF GIT_DIR="$TRASH_DIRECTORY/3/.git" GIT_WORK_TREE="$TRASH_DIRECTORY" test_repo 3/sub/sub ' +# +# case #4 +# +############################################################ +# +# Input: +# +# - GIT_WORK_TREE is not set +# - GIT_DIR is not set +# - core.worktree is set +# - .git is a directory +# - core.bare is not set, cwd is outside .git +# +# Output: +# +# core.worktree is ignored -> #0 + +test_expect_success '#4: setup' ' + unset GIT_DIR GIT_WORK_TREE && + mkdir 4 4/sub && + cd 4 && + git init && + git config core.worktree non-existent && + cd .. +' + +test_expect_failure '#4: at root' ' + cat >4/expected <<EOF && +setup: git_dir: .git +setup: worktree: $TRASH_DIRECTORY/4 +setup: cwd: $TRASH_DIRECTORY/4 +setup: prefix: (null) +EOF + test_repo 4 +' + +test_expect_failure '#4: in subdir' ' + cat >4/sub/expected <<EOF && +setup: git_dir: .git +setup: worktree: $TRASH_DIRECTORY/4 +setup: cwd: $TRASH_DIRECTORY/4 +setup: prefix: sub/ +EOF + test_repo 4/sub +' + test_done
--
1.7.0.2.445.gcbdb3