@@ -80,7 +80,7 @@ test_repo() {
80
80
# - cwd can't be outside worktree
81
81
82
82
test_expect_success ' #0: setup' '
83
- unset GIT_DIR GIT_WORK_TREE &&
83
+ sane_unset GIT_DIR GIT_WORK_TREE &&
84
84
mkdir 0 0/sub &&
85
85
cd 0 && git init && cd ..
86
86
'
123
123
# GIT_WORK_TREE is ignored -> #0
124
124
125
125
test_expect_success ' #1: setup' '
126
- unset GIT_DIR GIT_WORK_TREE &&
126
+ sane_unset GIT_DIR GIT_WORK_TREE &&
127
127
mkdir 1 1/sub 1.wt 1.wt/sub 1/wt 1/wt/sub &&
128
128
cd 1 &&
129
129
git init &&
174
174
# - cwd can't be outside worktree
175
175
176
176
test_expect_success ' #2: setup' '
177
- unset GIT_DIR GIT_WORK_TREE &&
177
+ sane_unset GIT_DIR GIT_WORK_TREE &&
178
178
mkdir 2 2/sub &&
179
179
cd 2 && git init && cd ..
180
180
'
241
241
# - cwd can be outside worktree
242
242
243
243
test_expect_success ' #3: setup' '
244
- unset GIT_DIR GIT_WORK_TREE &&
244
+ sane_unset GIT_DIR GIT_WORK_TREE &&
245
245
mkdir 3 3/sub 3/sub/sub 3.wt 3.wt/sub 3/wt 3/wt/sub &&
246
246
cd 3 && git init && cd ..
247
247
'
504
504
# core.worktree is ignored -> #0
505
505
506
506
test_expect_success ' #4: setup' '
507
- unset GIT_DIR GIT_WORK_TREE &&
507
+ sane_unset GIT_DIR GIT_WORK_TREE &&
508
508
mkdir 4 4/sub &&
509
509
cd 4 &&
510
510
git init &&
550
550
# GIT_WORK_TREE/core.worktree are ignored -> #0
551
551
552
552
test_expect_success ' #5: setup' '
553
- unset GIT_DIR GIT_WORK_TREE &&
553
+ sane_unset GIT_DIR GIT_WORK_TREE &&
554
554
mkdir 5 5/sub &&
555
555
cd 5 &&
556
556
git init &&
602
602
# - cwd can be outside worktree
603
603
604
604
test_expect_success ' #6: setup' '
605
- unset GIT_DIR GIT_WORK_TREE &&
605
+ sane_unset GIT_DIR GIT_WORK_TREE &&
606
606
mkdir 6 6/sub 6/sub/sub 6.wt 6.wt/sub 6/wt 6/wt/sub &&
607
607
cd 6 && git init && cd ..
608
608
'
889
889
# core.worktree is overridden by GIT_WORK_TREE -> #3
890
890
891
891
test_expect_success ' #7: setup' '
892
- unset GIT_DIR GIT_WORK_TREE &&
892
+ sane_unset GIT_DIR GIT_WORK_TREE &&
893
893
mkdir 7 7/sub 7/sub/sub 7.wt 7.wt/sub 7/wt 7/wt/sub &&
894
894
cd 7 &&
895
895
git init &&
@@ -1155,7 +1155,7 @@ EOF
1155
1155
# #0 except that git_dir is set by .git file
1156
1156
1157
1157
test_expect_success ' #8: setup' '
1158
- unset GIT_DIR GIT_WORK_TREE &&
1158
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1159
1159
mkdir 8 8/sub &&
1160
1160
cd 8 &&
1161
1161
git init &&
@@ -1202,7 +1202,7 @@ EOF
1202
1202
# #1 except that git_dir is set by .git file
1203
1203
1204
1204
test_expect_success ' #9: setup' '
1205
- unset GIT_DIR GIT_WORK_TREE &&
1205
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1206
1206
mkdir 9 9/sub 9.wt 9.wt/sub 9/wt 9/wt/sub &&
1207
1207
cd 9 &&
1208
1208
git init &&
@@ -1251,7 +1251,7 @@ EOF
1251
1251
# #2 except that git_dir is set by .git file
1252
1252
1253
1253
test_expect_success ' #10: setup' '
1254
- unset GIT_DIR GIT_WORK_TREE &&
1254
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1255
1255
mkdir 10 10/sub &&
1256
1256
cd 10 &&
1257
1257
git init &&
@@ -1318,7 +1318,7 @@ EOF
1318
1318
# #3 except that git_dir is set by .git file
1319
1319
1320
1320
test_expect_success ' #11: setup' '
1321
- unset GIT_DIR GIT_WORK_TREE &&
1321
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1322
1322
mkdir 11 11/sub 11/sub/sub 11.wt 11.wt/sub 11/wt 11/wt/sub &&
1323
1323
cd 11 &&
1324
1324
git init &&
@@ -1586,7 +1586,7 @@ EOF
1586
1586
1587
1587
1588
1588
test_expect_success ' #12: setup' '
1589
- unset GIT_DIR GIT_WORK_TREE &&
1589
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1590
1590
mkdir 12 12/sub 12/sub/sub 12.wt 12.wt/sub 12/wt 12/wt/sub &&
1591
1591
cd 12 &&
1592
1592
git init &&
@@ -1634,7 +1634,7 @@ EOF
1634
1634
# #5 except that git_dir is set by .git file
1635
1635
1636
1636
test_expect_success ' #13: setup' '
1637
- unset GIT_DIR GIT_WORK_TREE &&
1637
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1638
1638
mkdir 13 13/sub 13/sub/sub 13.wt 13.wt/sub 13/wt 13/wt/sub &&
1639
1639
cd 13 &&
1640
1640
git init &&
@@ -1684,7 +1684,7 @@ EOF
1684
1684
# #6 except that git_dir is set by .git file
1685
1685
1686
1686
test_expect_success ' #14: setup' '
1687
- unset GIT_DIR GIT_WORK_TREE &&
1687
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1688
1688
mkdir 14 14/sub 14/sub/sub 14.wt 14.wt/sub 14/wt 14/wt/sub &&
1689
1689
cd 14 &&
1690
1690
git init &&
@@ -1975,7 +1975,7 @@ EOF
1975
1975
# #7 except that git_dir is set by .git file
1976
1976
1977
1977
test_expect_success ' #15: setup' '
1978
- unset GIT_DIR GIT_WORK_TREE &&
1978
+ sane_unset GIT_DIR GIT_WORK_TREE &&
1979
1979
mkdir 15 15/sub 15/sub/sub 15.wt 15.wt/sub 15/wt 15/wt/sub &&
1980
1980
cd 15 &&
1981
1981
git init &&
@@ -2247,7 +2247,7 @@ EOF
2247
2247
# - cwd can't be outside worktree
2248
2248
2249
2249
test_expect_success ' #16.1: setup' '
2250
- unset GIT_DIR GIT_WORK_TREE &&
2250
+ sane_unset GIT_DIR GIT_WORK_TREE &&
2251
2251
mkdir 16 16/sub &&
2252
2252
cd 16 &&
2253
2253
git init &&
@@ -2378,7 +2378,7 @@ EOF
2378
2378
# GIT_WORK_TREE is ignored -> #16.1 (with warnings perhaps)
2379
2379
2380
2380
test_expect_success ' #17.1: setup' '
2381
- unset GIT_DIR GIT_WORK_TREE &&
2381
+ sane_unset GIT_DIR GIT_WORK_TREE &&
2382
2382
mkdir 17 17/sub &&
2383
2383
cd 17 &&
2384
2384
git init &&
@@ -2511,7 +2511,7 @@ EOF
2511
2511
# - cwd can't be outside worktree
2512
2512
2513
2513
test_expect_success ' #18: setup' '
2514
- unset GIT_DIR GIT_WORK_TREE &&
2514
+ sane_unset GIT_DIR GIT_WORK_TREE &&
2515
2515
mkdir 18 18/sub &&
2516
2516
cd 18 &&
2517
2517
git init &&
@@ -2578,7 +2578,7 @@ EOF
2578
2578
# bare repo is overridden by GIT_WORK_TREE -> #3
2579
2579
2580
2580
test_expect_success ' #19: setup' '
2581
- unset GIT_DIR GIT_WORK_TREE &&
2581
+ sane_unset GIT_DIR GIT_WORK_TREE &&
2582
2582
mkdir 19 19/sub 19/sub/sub 19.wt 19.wt/sub 19/wt 19/wt/sub &&
2583
2583
cd 19 &&
2584
2584
git init &&
@@ -2844,7 +2844,7 @@ EOF
2844
2844
# core.worktree is ignored -> #16.1
2845
2845
2846
2846
test_expect_success ' #20.1: setup' '
2847
- unset GIT_DIR GIT_WORK_TREE &&
2847
+ sane_unset GIT_DIR GIT_WORK_TREE &&
2848
2848
mkdir 20 20/sub &&
2849
2849
cd 20 &&
2850
2850
git init &&
@@ -2972,7 +2972,7 @@ EOF
2972
2972
# GIT_WORK_TREE/core.worktree are ignored -> #20.1
2973
2973
2974
2974
test_expect_success ' #21.1: setup' '
2975
- unset GIT_DIR GIT_WORK_TREE &&
2975
+ sane_unset GIT_DIR GIT_WORK_TREE &&
2976
2976
mkdir 21 21/sub &&
2977
2977
cd 21 &&
2978
2978
git init &&
@@ -3108,7 +3108,7 @@ EOF
3108
3108
# - cwd can be outside worktree
3109
3109
3110
3110
test_expect_success ' #22.1: setup' '
3111
- unset GIT_DIR GIT_WORK_TREE &&
3111
+ sane_unset GIT_DIR GIT_WORK_TREE &&
3112
3112
mkdir 22 &&
3113
3113
cd 22 &&
3114
3114
git init &&
@@ -3439,7 +3439,7 @@ test_expect_success '#22.2: at root' '
3439
3439
# core.worktree is overridden by GIT_WORK_TREE -> #19
3440
3440
3441
3441
test_expect_success ' #23: setup' '
3442
- unset GIT_DIR GIT_WORK_TREE &&
3442
+ sane_unset GIT_DIR GIT_WORK_TREE &&
3443
3443
mkdir 23 23/sub 23/sub/sub 23.wt 23.wt/sub 23/wt 23/wt/sub &&
3444
3444
cd 23 &&
3445
3445
git init &&
@@ -3706,7 +3706,7 @@ EOF
3706
3706
# #16.2 except git_dir is set according to .git file
3707
3707
3708
3708
test_expect_success ' #24: setup' '
3709
- unset GIT_DIR GIT_WORK_TREE &&
3709
+ sane_unset GIT_DIR GIT_WORK_TREE &&
3710
3710
mkdir 24 24/sub &&
3711
3711
cd 24 &&
3712
3712
git init &&
@@ -3754,7 +3754,7 @@ EOF
3754
3754
# #17.2 except git_dir is set according to .git file
3755
3755
3756
3756
test_expect_success ' #25: setup' '
3757
- unset GIT_DIR GIT_WORK_TREE &&
3757
+ sane_unset GIT_DIR GIT_WORK_TREE &&
3758
3758
mkdir 25 25/sub &&
3759
3759
cd 25 &&
3760
3760
git init &&
@@ -3804,7 +3804,7 @@ EOF
3804
3804
# #18 except git_dir is set according to .git file
3805
3805
3806
3806
test_expect_success ' #26: setup' '
3807
- unset GIT_DIR GIT_WORK_TREE &&
3807
+ sane_unset GIT_DIR GIT_WORK_TREE &&
3808
3808
mkdir 26 26/sub &&
3809
3809
cd 26 &&
3810
3810
git init &&
@@ -3872,7 +3872,7 @@ EOF
3872
3872
# #19 except git_dir is set according to .git file
3873
3873
3874
3874
test_expect_success ' #27: setup' '
3875
- unset GIT_DIR GIT_WORK_TREE &&
3875
+ sane_unset GIT_DIR GIT_WORK_TREE &&
3876
3876
mkdir 27 27/sub 27/sub/sub 27.wt 27.wt/sub 27/wt 27/wt/sub &&
3877
3877
cd 27 &&
3878
3878
git init &&
@@ -4140,7 +4140,7 @@ EOF
4140
4140
# core.worktree is ignored -> #24
4141
4141
4142
4142
test_expect_success ' #28: setup' '
4143
- unset GIT_DIR GIT_WORK_TREE &&
4143
+ sane_unset GIT_DIR GIT_WORK_TREE &&
4144
4144
mkdir 28 28/sub &&
4145
4145
cd 28 &&
4146
4146
git init &&
@@ -4189,7 +4189,7 @@ EOF
4189
4189
# GIT_WORK_TREE/core.worktree are ignored -> #28
4190
4190
4191
4191
test_expect_success ' #29: setup' '
4192
- unset GIT_DIR GIT_WORK_TREE &&
4192
+ sane_unset GIT_DIR GIT_WORK_TREE &&
4193
4193
mkdir 29 29/sub &&
4194
4194
cd 29 &&
4195
4195
git init &&
@@ -4239,7 +4239,7 @@ EOF
4239
4239
# core.worktree and core.bare conflict, won't fly.
4240
4240
4241
4241
test_expect_success ' #30: setup' '
4242
- unset GIT_DIR GIT_WORK_TREE &&
4242
+ sane_unset GIT_DIR GIT_WORK_TREE &&
4243
4243
mkdir 30 &&
4244
4244
cd 30 &&
4245
4245
git init &&
@@ -4278,7 +4278,7 @@ test_expect_success '#30: at root' '
4278
4278
# #23 except git_dir is set according to .git file
4279
4279
4280
4280
test_expect_success ' #31: setup' '
4281
- unset GIT_DIR GIT_WORK_TREE &&
4281
+ sane_unset GIT_DIR GIT_WORK_TREE &&
4282
4282
mkdir 31 31/sub 31/sub/sub 31.wt 31.wt/sub 31/wt 31/wt/sub &&
4283
4283
cd 31 &&
4284
4284
git init &&
0 commit comments