@@ -598,11 +598,20 @@ test_expect_success '#20b/c: core.worktree and core.bare conflict' '
598
598
mkdir -p 20b/.git/wt/sub &&
599
599
(
600
600
cd 20b/.git &&
601
- test_must_fail git symbolic-ref HEAD >/dev/null
601
+ test_must_fail git status >/dev/null
602
602
) 2>message &&
603
603
grep "core.bare and core.worktree" message
604
604
'
605
605
606
+ test_expect_success ' #20d: core.worktree and core.bare OK when working tree not needed' '
607
+ setup_repo 20d non-existent "" true &&
608
+ mkdir -p 20d/.git/wt/sub &&
609
+ (
610
+ cd 20d/.git &&
611
+ git config foo.bar value
612
+ )
613
+ '
614
+
606
615
# Case #21: core.worktree/GIT_WORK_TREE overrides core.bare' '
607
616
test_expect_success ' #21: setup, core.worktree warns before overriding core.bare' '
608
617
setup_repo 21 non-existent "" unset &&
@@ -611,7 +620,7 @@ test_expect_success '#21: setup, core.worktree warns before overriding core.bare
611
620
cd 21/.git &&
612
621
GIT_WORK_TREE="$here/21" &&
613
622
export GIT_WORK_TREE &&
614
- git symbolic-ref HEAD >/dev/null
623
+ git status >/dev/null
615
624
) 2>message &&
616
625
! test -s message
617
626
@@ -700,13 +709,13 @@ test_expect_success '#22.2: core.worktree and core.bare conflict' '
700
709
cd 22/.git &&
701
710
GIT_DIR=. &&
702
711
export GIT_DIR &&
703
- test_must_fail git symbolic-ref HEAD 2>result
712
+ test_must_fail git status 2>result
704
713
) &&
705
714
(
706
715
cd 22 &&
707
716
GIT_DIR=.git &&
708
717
export GIT_DIR &&
709
- test_must_fail git symbolic-ref HEAD 2>result
718
+ test_must_fail git status 2>result
710
719
) &&
711
720
grep "core.bare and core.worktree" 22/.git/result &&
712
721
grep "core.bare and core.worktree" 22/result
@@ -752,9 +761,8 @@ test_expect_success '#28: core.worktree and core.bare conflict (gitfile case)' '
752
761
setup_repo 28 "$here/28" gitfile true &&
753
762
(
754
763
cd 28 &&
755
- test_must_fail git symbolic-ref HEAD
764
+ test_must_fail git status
756
765
) 2>message &&
757
- ! grep "^warning:" message &&
758
766
grep "core.bare and core.worktree" message
759
767
'
760
768
@@ -766,7 +774,7 @@ test_expect_success '#29: setup' '
766
774
cd 29 &&
767
775
GIT_WORK_TREE="$here/29" &&
768
776
export GIT_WORK_TREE &&
769
- git symbolic-ref HEAD >/dev/null
777
+ git status
770
778
) 2>message &&
771
779
! test -s message
772
780
'
@@ -777,7 +785,7 @@ test_expect_success '#30: core.worktree and core.bare conflict (gitfile version)
777
785
setup_repo 30 "$here/30" gitfile true &&
778
786
(
779
787
cd 30 &&
780
- test_must_fail env GIT_DIR=.git git symbolic-ref HEAD 2>result
788
+ test_must_fail env GIT_DIR=.git git status 2>result
781
789
) &&
782
790
grep "core.bare and core.worktree" 30/result
783
791
'
0 commit comments