subtree: t7900: update for having the default branch name be 'main'
Most of the tests had been converted to support `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`, but `contrib/subtree/t/` hadn't. Convert it. Most of the mentions of 'master' can just be replaced with 'HEAD'. Signed-off-by: Luke Shumaker <lukeshu@datawire.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Luke Shumaker committed
Apr 27, 2021 at 15:17 UTC
914d5125510f50cd8761768f16970a29cbce909c
1 file changed
+59
-58
contrib/subtree/t/t7900-subtree.sh
+59
-58
@@ -103,7 +103,7 @@ test_expect_success 'no merge from non-existent subtree' '
103
test_create_commit "$subtree_test_count/sub proj" sub1 &&
104
(
105
cd "$subtree_test_count" &&
106
- git fetch ./"sub proj" master &&
106
+ git fetch ./"sub proj" HEAD &&
107
test_must_fail git subtree merge --prefix="sub dir" FETCH_HEAD
108
)
109
'
@@ -116,8 +116,8 @@ test_expect_success 'no pull from non-existent subtree' '
116
test_create_commit "$subtree_test_count/sub proj" sub1 &&
117
(
118
cd "$subtree_test_count" &&
119
- git fetch ./"sub proj" master &&
120
- test_must_fail git subtree pull --prefix="sub dir" ./"sub proj" master
119
+ git fetch ./"sub proj" HEAD &&
120
+ test_must_fail git subtree pull --prefix="sub dir" ./"sub proj" HEAD
121
)'
122
123
next_test
@@ -128,7 +128,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix' '
128
test_create_commit "$subtree_test_count/sub proj" sub1 &&
129
(
130
cd "$subtree_test_count" &&
131
- git fetch ./"sub proj" master &&
131
+ git fetch ./"sub proj" HEAD &&
132
git subtree add --prefix="sub dir" FETCH_HEAD &&
133
check_equal "$(last_commit_message)" "Add '\''sub dir/'\'' from commit '\''$(git rev-parse FETCH_HEAD)'\''"
134
)
@@ -142,7 +142,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix and --me
142
test_create_commit "$subtree_test_count/sub proj" sub1 &&
143
(
144
cd "$subtree_test_count" &&
145
- git fetch ./"sub proj" master &&
145
+ git fetch ./"sub proj" HEAD &&
146
git subtree add --prefix="sub dir" --message="Added subproject" FETCH_HEAD &&
147
check_equal "$(last_commit_message)" "Added subproject"
148
)
@@ -156,7 +156,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --prefix as -P an
156
test_create_commit "$subtree_test_count/sub proj" sub1 &&
157
(
158
cd "$subtree_test_count" &&
159
- git fetch ./"sub proj" master &&
159
+ git fetch ./"sub proj" HEAD &&
160
git subtree add -P "sub dir" -m "Added subproject" FETCH_HEAD &&
161
check_equal "$(last_commit_message)" "Added subproject"
162
)
@@ -170,7 +170,7 @@ test_expect_success 'add subproj as subtree into sub dir/ with --squash and --pr
170
test_create_commit "$subtree_test_count/sub proj" sub1 &&
171
(
172
cd "$subtree_test_count" &&
173
- git fetch ./"sub proj" master &&
173
+ git fetch ./"sub proj" HEAD &&
174
git subtree add --prefix="sub dir" --message="Added subproject with squash" --squash FETCH_HEAD &&
175
check_equal "$(last_commit_message)" "Added subproject with squash"
176
)
@@ -188,13 +188,13 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix' '
188
test_create_commit "$subtree_test_count/sub proj" sub1 &&
189
(
190
cd "$subtree_test_count" &&
191
- git fetch ./"sub proj" master &&
191
+ git fetch ./"sub proj" HEAD &&
192
git subtree add --prefix="sub dir" FETCH_HEAD
193
) &&
194
test_create_commit "$subtree_test_count/sub proj" sub2 &&
195
(
196
cd "$subtree_test_count" &&
197
- git fetch ./"sub proj" master &&
197
+ git fetch ./"sub proj" HEAD &&
198
git subtree merge --prefix="sub dir" FETCH_HEAD &&
199
check_equal "$(last_commit_message)" "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
200
)
@@ -208,13 +208,13 @@ test_expect_success 'merge new subproj history into sub dir/ with --prefix and -
208
test_create_commit "$subtree_test_count/sub proj" sub1 &&
209
(
210
cd "$subtree_test_count" &&
211
- git fetch ./"sub proj" master &&
211
+ git fetch ./"sub proj" HEAD &&
212
git subtree add --prefix="sub dir" FETCH_HEAD
213
) &&
214
test_create_commit "$subtree_test_count/sub proj" sub2 &&
215
(
216
cd "$subtree_test_count" &&
217
- git fetch ./"sub proj" master &&
217
+ git fetch ./"sub proj" HEAD &&
218
git subtree merge --prefix="sub dir" --message="Merged changes from subproject" FETCH_HEAD &&
219
check_equal "$(last_commit_message)" "Merged changes from subproject"
220
)
@@ -228,13 +228,13 @@ test_expect_success 'merge new subproj history into sub dir/ with --squash and -
228
test_create_commit "$subtree_test_count/sub proj" sub1 &&
229
(
230
cd "$subtree_test_count" &&
231
- git fetch ./"sub proj" master &&
231
+ git fetch ./"sub proj" HEAD &&
232
git subtree add --prefix="sub dir" FETCH_HEAD
233
) &&
234
test_create_commit "$subtree_test_count/sub proj" sub2 &&
235
(
236
cd "$subtree_test_count" &&
237
- git fetch ./"sub proj" master &&
237
+ git fetch ./"sub proj" HEAD &&
238
git subtree merge --prefix="sub dir" --message="Merged changes from subproject using squash" --squash FETCH_HEAD &&
239
check_equal "$(last_commit_message)" "Merged changes from subproject using squash"
240
)
@@ -248,7 +248,7 @@ test_expect_success 'merge the added subproj again, should do nothing' '
248
test_create_commit "$subtree_test_count/sub proj" sub1 &&
249
(
250
cd "$subtree_test_count" &&
251
- git fetch ./"sub proj" master &&
251
+ git fetch ./"sub proj" HEAD &&
252
git subtree add --prefix="sub dir" FETCH_HEAD &&
253
# this shouldn not actually do anything, since FETCH_HEAD
254
# is already a parent
@@ -265,13 +265,13 @@ test_expect_success 'merge new subproj history into subdir/ with a slash appende
265
test_create_commit "$test_count/subproj" sub1 &&
266
(
267
cd "$test_count" &&
268
- git fetch ./subproj master &&
268
+ git fetch ./subproj HEAD &&
269
git subtree add --prefix=subdir/ FETCH_HEAD
270
) &&
271
test_create_commit "$test_count/subproj" sub2 &&
272
(
273
cd "$test_count" &&
274
- git fetch ./subproj master &&
274
+ git fetch ./subproj HEAD &&
275
git subtree merge --prefix=subdir/ FETCH_HEAD &&
276
check_equal "$(last_commit_message)" "Merge commit '\''$(git rev-parse FETCH_HEAD)'\''"
277
)
@@ -289,7 +289,7 @@ test_expect_success 'split requires option --prefix' '
289
test_create_commit "$subtree_test_count/sub proj" sub1 &&
290
(
291
cd "$subtree_test_count" &&
292
- git fetch ./"sub proj" master &&
292
+ git fetch ./"sub proj" HEAD &&
293
git subtree add --prefix="sub dir" FETCH_HEAD &&
294
echo "You must provide the --prefix option." > expected &&
295
test_must_fail git subtree split > actual 2>&1 &&
@@ -309,7 +309,7 @@ test_expect_success 'split requires path given by option --prefix must exist' '
309
test_create_commit "$subtree_test_count/sub proj" sub1 &&
310
(
311
cd "$subtree_test_count" &&
312
- git fetch ./"sub proj" master &&
312
+ git fetch ./"sub proj" HEAD &&
313
git subtree add --prefix="sub dir" FETCH_HEAD &&
314
echo "'\''non-existent-directory'\'' does not exist; use '\''git subtree add'\''" > expected &&
315
test_must_fail git subtree split --prefix=non-existent-directory > actual 2>&1 &&
@@ -329,7 +329,7 @@ test_expect_success 'split sub dir/ with --rejoin' '
329
test_create_commit "$subtree_test_count/sub proj" sub1 &&
330
(
331
cd "$subtree_test_count" &&
332
- git fetch ./"sub proj" master &&
332
+ git fetch ./"sub proj" HEAD &&
333
git subtree add --prefix="sub dir" FETCH_HEAD
334
) &&
335
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -338,7 +338,7 @@ test_expect_success 'split sub dir/ with --rejoin' '
338
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
339
(
340
cd "$subtree_test_count" &&
341
- git fetch ./"sub proj" master &&
341
+ git fetch ./"sub proj" HEAD &&
342
git subtree merge --prefix="sub dir" FETCH_HEAD &&
343
split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
344
git subtree split --prefix="sub dir" --annotate="*" --rejoin &&
@@ -370,7 +370,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
370
test_create_commit "$subtree_test_count/sub proj" sub1 &&
371
(
372
cd "$subtree_test_count" &&
373
- git fetch ./"sub proj" master &&
373
+ git fetch ./"sub proj" HEAD &&
374
git subtree add --prefix="sub dir" FETCH_HEAD
375
) &&
376
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -379,7 +379,7 @@ test_expect_success 'split sub dir/ with --rejoin and --message' '
379
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
380
(
381
cd "$subtree_test_count" &&
382
- git fetch ./"sub proj" master &&
382
+ git fetch ./"sub proj" HEAD &&
383
git subtree merge --prefix="sub dir" FETCH_HEAD &&
384
git subtree split --prefix="sub dir" --message="Split & rejoin" --annotate="*" --rejoin &&
385
check_equal "$(last_commit_message)" "Split & rejoin"
@@ -394,7 +394,7 @@ test_expect_success 'split "sub dir"/ with --branch' '
394
test_create_commit "$subtree_test_count/sub proj" sub1 &&
395
(
396
cd "$subtree_test_count" &&
397
- git fetch ./"sub proj" master &&
397
+ git fetch ./"sub proj" HEAD &&
398
git subtree add --prefix="sub dir" FETCH_HEAD
399
) &&
400
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -403,7 +403,7 @@ test_expect_success 'split "sub dir"/ with --branch' '
403
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
404
(
405
cd "$subtree_test_count" &&
406
- git fetch ./"sub proj" master &&
406
+ git fetch ./"sub proj" HEAD &&
407
git subtree merge --prefix="sub dir" FETCH_HEAD &&
408
split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
409
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br &&
@@ -419,7 +419,7 @@ test_expect_success 'check hash of split' '
419
test_create_commit "$subtree_test_count/sub proj" sub1 &&
420
(
421
cd "$subtree_test_count" &&
422
- git fetch ./"sub proj" master &&
422
+ git fetch ./"sub proj" HEAD &&
423
git subtree add --prefix="sub dir" FETCH_HEAD
424
) &&
425
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -428,7 +428,7 @@ test_expect_success 'check hash of split' '
428
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
429
(
430
cd "$subtree_test_count" &&
431
- git fetch ./"sub proj" master &&
431
+ git fetch ./"sub proj" HEAD &&
432
git subtree merge --prefix="sub dir" FETCH_HEAD &&
433
split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
434
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br &&
@@ -451,7 +451,7 @@ test_expect_success 'split "sub dir"/ with --branch for an existing branch' '
451
test_create_commit "$subtree_test_count/sub proj" sub1 &&
452
(
453
cd "$subtree_test_count" &&
454
- git fetch ./"sub proj" master &&
454
+ git fetch ./"sub proj" HEAD &&
455
git branch subproj-br FETCH_HEAD &&
456
git subtree add --prefix="sub dir" FETCH_HEAD
457
) &&
@@ -461,7 +461,7 @@ test_expect_success 'split "sub dir"/ with --branch for an existing branch' '
461
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
462
(
463
cd "$subtree_test_count" &&
464
- git fetch ./"sub proj" master &&
464
+ git fetch ./"sub proj" HEAD &&
465
git subtree merge --prefix="sub dir" FETCH_HEAD &&
466
split_hash=$(git subtree split --prefix="sub dir" --annotate="*") &&
467
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br &&
@@ -478,7 +478,7 @@ test_expect_success 'split "sub dir"/ with --branch for an incompatible branch'
478
(
479
cd "$subtree_test_count" &&
480
git branch init HEAD &&
481
- git fetch ./"sub proj" master &&
481
+ git fetch ./"sub proj" HEAD &&
482
git subtree add --prefix="sub dir" FETCH_HEAD
483
) &&
484
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -487,7 +487,7 @@ test_expect_success 'split "sub dir"/ with --branch for an incompatible branch'
487
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
488
(
489
cd "$subtree_test_count" &&
490
- git fetch ./"sub proj" master &&
490
+ git fetch ./"sub proj" HEAD &&
491
git subtree merge --prefix="sub dir" FETCH_HEAD &&
492
test_must_fail git subtree split --prefix="sub dir" --branch init
493
)
@@ -505,7 +505,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub
505
test_create_commit "$subtree_test_count/sub proj" sub1 &&
506
(
507
cd "$subtree_test_count" &&
508
- git fetch ./"sub proj" master &&
508
+ git fetch ./"sub proj" HEAD &&
509
git subtree add --prefix="sub dir" FETCH_HEAD
510
) &&
511
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -514,7 +514,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the sub
514
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
515
(
516
cd "$subtree_test_count" &&
517
- git fetch ./"sub proj" master &&
517
+ git fetch ./"sub proj" HEAD &&
518
git subtree merge --prefix="sub dir" FETCH_HEAD &&
519
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
520
) &&
@@ -555,7 +555,7 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t
555
test_create_commit "$subtree_test_count/sub proj" sub1 &&
556
(
557
cd "$subtree_test_count" &&
558
- git fetch ./"sub proj" master &&
558
+ git fetch ./"sub proj" HEAD &&
559
git subtree add --prefix="sub dir" FETCH_HEAD
560
) &&
561
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -564,7 +564,7 @@ test_expect_success 'make sure the subproj *only* contains commits that affect t
564
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
565
(
566
cd "$subtree_test_count" &&
567
- git fetch ./"sub proj" master &&
567
+ git fetch ./"sub proj" HEAD &&
568
git subtree merge --prefix="sub dir" FETCH_HEAD &&
569
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
570
) &&
@@ -606,7 +606,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
606
test_create_commit "$subtree_test_count/sub proj" sub1 &&
607
(
608
cd "$subtree_test_count" &&
609
- git fetch ./"sub proj" master &&
609
+ git fetch ./"sub proj" HEAD &&
610
git subtree add --prefix="sub dir" FETCH_HEAD
611
) &&
612
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -615,7 +615,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
615
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
616
(
617
cd "$subtree_test_count" &&
618
- git fetch ./"sub proj" master &&
618
+ git fetch ./"sub proj" HEAD &&
619
git subtree merge --prefix="sub dir" FETCH_HEAD &&
620
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
621
) &&
@@ -643,7 +643,7 @@ test_expect_success 'make sure exactly the right set of files ends up in the mai
643
) &&
644
(
645
cd "$subtree_test_count" &&
646
- git subtree pull --prefix="sub dir" ./"sub proj" master &&
646
+ git subtree pull --prefix="sub dir" ./"sub proj" HEAD &&
647
648
test_write_lines main1 main2 >chkm &&
649
test_write_lines main-sub1 main-sub2 main-sub3 main-sub4 >chkms &&
@@ -666,7 +666,7 @@ test_expect_success 'make sure each filename changed exactly once in the entire
666
(
667
cd "$subtree_test_count" &&
668
git config log.date relative &&
669
- git fetch ./"sub proj" master &&
669
+ git fetch ./"sub proj" HEAD &&
670
git subtree add --prefix="sub dir" FETCH_HEAD
671
) &&
672
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -675,7 +675,7 @@ test_expect_success 'make sure each filename changed exactly once in the entire
675
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
676
(
677
cd "$subtree_test_count" &&
678
- git fetch ./"sub proj" master &&
678
+ git fetch ./"sub proj" HEAD &&
679
git subtree merge --prefix="sub dir" FETCH_HEAD &&
680
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
681
) &&
@@ -703,7 +703,7 @@ test_expect_success 'make sure each filename changed exactly once in the entire
703
) &&
704
(
705
cd "$subtree_test_count" &&
706
- git subtree pull --prefix="sub dir" ./"sub proj" master &&
706
+ git subtree pull --prefix="sub dir" ./"sub proj" HEAD &&
707
708
test_write_lines main1 main2 >chkm &&
709
test_write_lines sub1 sub2 sub3 sub4 >chks &&
@@ -731,7 +731,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
731
test_create_commit "$subtree_test_count/sub proj" sub1 &&
732
(
733
cd "$subtree_test_count" &&
734
- git fetch ./"sub proj" master &&
734
+ git fetch ./"sub proj" HEAD &&
735
git subtree add --prefix="sub dir" FETCH_HEAD
736
) &&
737
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -740,7 +740,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
740
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
741
(
742
cd "$subtree_test_count" &&
743
- git fetch ./"sub proj" master &&
743
+ git fetch ./"sub proj" HEAD &&
744
git subtree merge --prefix="sub dir" FETCH_HEAD &&
745
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
746
) &&
@@ -768,7 +768,7 @@ test_expect_success 'make sure the --rejoin commits never make it into subproj'
768
) &&
769
(
770
cd "$subtree_test_count" &&
771
- git subtree pull --prefix="sub dir" ./"sub proj" master &&
771
+ git subtree pull --prefix="sub dir" ./"sub proj" HEAD &&
772
check_equal "$(git log --pretty=format:"%s" HEAD^2 | grep -i split)" ""
773
)
774
'
@@ -781,7 +781,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
781
test_create_commit "$subtree_test_count/sub proj" sub1 &&
782
(
783
cd "$subtree_test_count" &&
784
- git fetch ./"sub proj" master &&
784
+ git fetch ./"sub proj" HEAD &&
785
git subtree add --prefix="sub dir" FETCH_HEAD
786
) &&
787
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -790,7 +790,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
790
test_create_commit "$subtree_test_count" "sub dir"/main-sub2 &&
791
(
792
cd "$subtree_test_count" &&
793
- git fetch ./"sub proj" master &&
793
+ git fetch ./"sub proj" HEAD &&
794
git subtree merge --prefix="sub dir" FETCH_HEAD &&
795
git subtree split --prefix="sub dir" --annotate="*" --branch subproj-br --rejoin
796
) &&
@@ -818,7 +818,7 @@ test_expect_success 'make sure no "git subtree" tagged commits make it into subp
818
) &&
819
(
820
cd "$subtree_test_count" &&
821
- git subtree pull --prefix="sub dir" ./"sub proj" master &&
821
+ git subtree pull --prefix="sub dir" ./"sub proj" HEAD &&
822
823
# They are meaningless to subproj since one side of the merge refers to the mainline
824
check_equal "$(git log --pretty=format:"%s%n%b" HEAD^2 | grep "git-subtree.*:")" ""
@@ -837,13 +837,13 @@ test_expect_success 'make sure "git subtree split" find the correct parent' '
837
test_create_commit "$subtree_test_count/sub proj" sub1 &&
838
(
839
cd "$subtree_test_count" &&
840
- git fetch ./"sub proj" master &&
840
+ git fetch ./"sub proj" HEAD &&
841
git subtree add --prefix="sub dir" FETCH_HEAD
842
) &&
843
test_create_commit "$subtree_test_count/sub proj" sub2 &&
844
(
845
cd "$subtree_test_count" &&
846
- git fetch ./"sub proj" master &&
846
+ git fetch ./"sub proj" HEAD &&
847
git branch subproj-ref FETCH_HEAD &&
848
git subtree merge --prefix="sub dir" FETCH_HEAD
849
) &&
@@ -853,7 +853,7 @@ test_expect_success 'make sure "git subtree split" find the correct parent' '
853
git subtree split --prefix="sub dir" --branch subproj-br &&
854
855
# at this point, the new commit parent should be subproj-ref, if it is
856
- # not, something went wrong (the "newparent" of "master~" commit should
856
+ # not, something went wrong (the "newparent" of "HEAD~" commit should
857
# have been sub2, but it was not, because its cache was not set to
858
# itself)
859
check_equal "$(git log --pretty=format:%P -1 subproj-br)" "$(git rev-parse subproj-ref)"
@@ -868,13 +868,13 @@ test_expect_success 'split a new subtree without --onto option' '
868
test_create_commit "$subtree_test_count/sub proj" sub1 &&
869
(
870
cd "$subtree_test_count" &&
871
- git fetch ./"sub proj" master &&
871
+ git fetch ./"sub proj" HEAD &&
872
git subtree add --prefix="sub dir" FETCH_HEAD
873
) &&
874
test_create_commit "$subtree_test_count/sub proj" sub2 &&
875
(
876
cd "$subtree_test_count" &&
877
- git fetch ./"sub proj" master &&
877
+ git fetch ./"sub proj" HEAD &&
878
git subtree merge --prefix="sub dir" FETCH_HEAD
879
) &&
880
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -903,14 +903,14 @@ test_expect_success 'verify one file change per commit' '
903
test_create_commit "$subtree_test_count/sub proj" sub1 &&
904
(
905
cd "$subtree_test_count" &&
906
- git fetch ./"sub proj" master &&
906
+ git fetch ./"sub proj" HEAD &&
907
git branch sub1 FETCH_HEAD &&
908
git subtree add --prefix="sub dir" sub1
909
) &&
910
test_create_commit "$subtree_test_count/sub proj" sub2 &&
911
(
912
cd "$subtree_test_count" &&
913
- git fetch ./"sub proj" master &&
913
+ git fetch ./"sub proj" HEAD &&
914
git subtree merge --prefix="sub dir" FETCH_HEAD
915
) &&
916
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -947,7 +947,7 @@ test_expect_success 'push split to subproj' '
947
test_create_commit "$subtree_test_count/sub proj" sub1 &&
948
(
949
cd "$subtree_test_count" &&
950
- git fetch ./"sub proj" master &&
950
+ git fetch ./"sub proj" HEAD &&
951
git subtree add --prefix="sub dir" FETCH_HEAD
952
) &&
953
test_create_commit "$subtree_test_count" "sub dir"/main-sub1 &&
@@ -958,7 +958,7 @@ test_expect_success 'push split to subproj' '
958
cd $subtree_test_count/"sub proj" &&
959
git branch sub-branch-1 &&
960
cd .. &&
961
- git fetch ./"sub proj" master &&
961
+ git fetch ./"sub proj" HEAD &&
962
git subtree merge --prefix="sub dir" FETCH_HEAD
963
) &&
964
test_create_commit "$subtree_test_count" "sub dir"/main-sub3 &&
@@ -994,6 +994,7 @@ test_expect_success 'push split to subproj' '
994
next_test
995
test_expect_success 'subtree descendant check' '
996
subtree_test_create_repo "$subtree_test_count" &&
997
+ defaultBranch=$(sed "s,ref: refs/heads/,," "$subtree_test_count/.git/HEAD") &&
998
test_create_commit "$subtree_test_count" folder_subtree/a &&
999
(
1000
cd "$subtree_test_count" &&
@@ -1010,7 +1011,7 @@ test_expect_success 'subtree descendant check' '
1011
(
1012
cd "$subtree_test_count" &&
1013
git cherry-pick $cherry &&
1013
- git checkout master &&
1014
+ git checkout $defaultBranch &&
1015
git merge -m "merge should be kept on subtree" branch &&
1016
git branch no_subtree_work_branch
1017
) &&
@@ -1022,10 +1023,10 @@ test_expect_success 'subtree descendant check' '
1023
test_create_commit "$subtree_test_count" not_a_subtree_change &&
1024
(
1025
cd "$subtree_test_count" &&
1025
- git checkout master &&
1026
+ git checkout $defaultBranch &&
1027
git merge -m "merge should be skipped on subtree" no_subtree_work_branch &&
1028
1028
- git subtree split --prefix folder_subtree/ --branch subtree_tip master &&
1029
+ git subtree split --prefix folder_subtree/ --branch subtree_tip $defaultBranch &&
1030
git subtree split --prefix folder_subtree/ --branch subtree_branch branch &&
1031
check_equal $(git rev-list --count subtree_tip..subtree_branch) 0
1032
)