diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-16 14:27:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-16 14:27:06 -0700 |
commit | 103b6f9c2b2bbafdbde694f9390fb203f70977f0 (patch) | |
tree | dbdc12e487fe6474ae9bf661e2a20020ea4cf81e /t/t1510-repo-setup.sh | |
parent | c7ca4424ea5644c6aa2c660a4a0726a75f8f2b84 (diff) | |
parent | fada767463b599951b37bd544379a1d18dcf9370 (diff) | |
download | git-103b6f9c2b2bbafdbde694f9390fb203f70977f0.tar.gz |
Merge branch 'jk/die-on-bogus-worktree-late'
The setup code used to die when core.bare and core.worktree are set
inconsistently, even for commands that do not need working tree.
* jk/die-on-bogus-worktree-late:
setup_git_directory: delay core.bare/core.worktree errors
Diffstat (limited to 't/t1510-repo-setup.sh')
-rwxr-xr-x | t/t1510-repo-setup.sh | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh index 33c1a587b3..13ae12dfa7 100755 --- a/t/t1510-repo-setup.sh +++ b/t/t1510-repo-setup.sh @@ -599,11 +599,20 @@ test_expect_success '#20b/c: core.worktree and core.bare conflict' ' mkdir -p 20b/.git/wt/sub && ( cd 20b/.git && - test_must_fail git symbolic-ref HEAD >/dev/null + test_must_fail git status >/dev/null ) 2>message && grep "core.bare and core.worktree" message ' +test_expect_success '#20d: core.worktree and core.bare OK when working tree not needed' ' + setup_repo 20d non-existent "" true && + mkdir -p 20d/.git/wt/sub && + ( + cd 20d/.git && + git config foo.bar value + ) +' + # Case #21: core.worktree/GIT_WORK_TREE overrides core.bare' ' test_expect_success '#21: setup, core.worktree warns before overriding core.bare' ' setup_repo 21 non-existent "" unset && @@ -612,7 +621,7 @@ test_expect_success '#21: setup, core.worktree warns before overriding core.bare cd 21/.git && GIT_WORK_TREE="$here/21" && export GIT_WORK_TREE && - git symbolic-ref HEAD >/dev/null + git status >/dev/null ) 2>message && ! test -s message @@ -701,13 +710,13 @@ test_expect_success '#22.2: core.worktree and core.bare conflict' ' cd 22/.git && GIT_DIR=. && export GIT_DIR && - test_must_fail git symbolic-ref HEAD 2>result + test_must_fail git status 2>result ) && ( cd 22 && GIT_DIR=.git && export GIT_DIR && - test_must_fail git symbolic-ref HEAD 2>result + test_must_fail git status 2>result ) && grep "core.bare and core.worktree" 22/.git/result && grep "core.bare and core.worktree" 22/result @@ -753,9 +762,8 @@ test_expect_success '#28: core.worktree and core.bare conflict (gitfile case)' ' setup_repo 28 "$here/28" gitfile true && ( cd 28 && - test_must_fail git symbolic-ref HEAD + test_must_fail git status ) 2>message && - ! grep "^warning:" message && grep "core.bare and core.worktree" message ' @@ -767,7 +775,7 @@ test_expect_success '#29: setup' ' cd 29 && GIT_WORK_TREE="$here/29" && export GIT_WORK_TREE && - git symbolic-ref HEAD >/dev/null + git status ) 2>message && ! test -s message ' @@ -778,7 +786,7 @@ test_expect_success '#30: core.worktree and core.bare conflict (gitfile version) setup_repo 30 "$here/30" gitfile true && ( cd 30 && - test_must_fail env GIT_DIR=.git git symbolic-ref HEAD 2>result + test_must_fail env GIT_DIR=.git git status 2>result ) && grep "core.bare and core.worktree" 30/result ' |