Skip to content

Commit 54a3c67

Browse files
committed
Merge branch 'jc/push-2.0-default-to-simple' (early part)
Adjust our tests for upcoming migration of the default value for the "push.default" configuration variable to "simple" from "mixed". * 'jc/push-2.0-default-to-simple' (early part): t5570: do not assume the "matching" push is the default t5551: do not assume the "matching" push is the default t5550: do not assume the "matching" push is the default t9401: do not assume the "matching" push is the default t9400: do not assume the "matching" push is the default t7406: do not assume the "matching" push is the default t5531: do not assume the "matching" push is the default t5519: do not assume the "matching" push is the default t5517: do not assume the "matching" push is the default t5516: do not assume the "matching" push is the default t5505: do not assume the "matching" push is the default t5404: do not assume the "matching" push is the default
2 parents 8dd2858 + ac47a22 commit 54a3c67

12 files changed

+24
-16
lines changed

t/t5404-tracking-branches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_expect_success 'prepare pushable branches' '
3636
'
3737

3838
test_expect_success 'mixed-success push returns error' '
39-
test_must_fail git push
39+
test_must_fail git push origin :
4040
'
4141

4242
test_expect_success 'check tracking branches updated correctly after push' '

t/t5505-remote.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ test_expect_success 'fetch mirrors do not act as mirrors during push' '
345345
) &&
346346
(cd mirror-fetch/child &&
347347
git branch -m renamed renamed2 &&
348-
git push parent
348+
git push parent :
349349
) &&
350350
(cd mirror-fetch/parent &&
351351
git rev-parse --verify renamed &&

t/t5516-fetch-push.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
252252
test_expect_success 'push with matching heads' '
253253
254254
mk_test testrepo heads/master &&
255-
git push testrepo &&
255+
git push testrepo : &&
256256
check_push_result testrepo $the_commit heads/master
257257
258258
'
@@ -281,7 +281,7 @@ test_expect_success 'push --force with matching heads' '
281281
mk_test testrepo heads/master &&
282282
git push testrepo : &&
283283
git commit --amend -massaged &&
284-
git push --force testrepo &&
284+
git push --force testrepo : &&
285285
! check_push_result testrepo $the_commit heads/master &&
286286
git reset --hard $the_commit
287287
@@ -504,6 +504,7 @@ test_expect_success 'push with remote.pushdefault' '
504504
test_config remote.down.url down_repo &&
505505
test_config branch.master.remote up &&
506506
test_config remote.pushdefault down &&
507+
test_config push.default matching &&
507508
git push &&
508509
check_push_result up_repo $the_first_commit heads/master &&
509510
check_push_result down_repo $the_commit heads/master
@@ -515,7 +516,7 @@ test_expect_success 'push with config remote.*.pushurl' '
515516
git checkout master &&
516517
test_config remote.there.url test2repo &&
517518
test_config remote.there.pushurl testrepo &&
518-
git push there &&
519+
git push there : &&
519520
check_push_result testrepo $the_commit heads/master
520521
'
521522

@@ -528,6 +529,7 @@ test_expect_success 'push with config branch.*.pushremote' '
528529
test_config remote.down.url down_repo &&
529530
test_config branch.master.remote up &&
530531
test_config branch.master.pushremote down &&
532+
test_config push.default matching &&
531533
git push &&
532534
check_push_result up_repo $the_first_commit heads/master &&
533535
check_push_result side_repo $the_first_commit heads/master &&
@@ -541,7 +543,7 @@ test_expect_success 'push with dry-run' '
541543
cd testrepo &&
542544
old_commit=$(git show-ref -s --verify refs/heads/master)
543545
) &&
544-
git push --dry-run testrepo &&
546+
git push --dry-run testrepo : &&
545547
check_push_result testrepo $old_commit heads/master
546548
'
547549

@@ -1022,7 +1024,7 @@ test_expect_success 'push --porcelain --dry-run rejected' '
10221024

10231025
test_expect_success 'push --prune' '
10241026
mk_test testrepo heads/master heads/second heads/foo heads/bar &&
1025-
git push --prune testrepo &&
1027+
git push --prune testrepo : &&
10261028
check_push_result testrepo $the_commit heads/master &&
10271029
check_push_result testrepo $the_first_commit heads/second &&
10281030
! check_push_result testrepo $the_first_commit heads/foo heads/bar

t/t5517-push-mirror.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
256256
git branch keep master &&
257257
git push --mirror up &&
258258
git branch -D keep &&
259-
git push up
259+
git push up :
260260
) &&
261261
(
262262
cd mirror &&

t/t5519-push-alternates.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test_expect_success 'alice works and pushes' '
4040
cd alice-work &&
4141
echo more >file &&
4242
git commit -a -m second &&
43-
git push ../alice-pub
43+
git push ../alice-pub :
4444
)
4545
'
4646

@@ -57,7 +57,7 @@ test_expect_success 'bob fetches from alice, works and pushes' '
5757
git pull ../alice-pub master &&
5858
echo more bob >file &&
5959
git commit -a -m third &&
60-
git push ../bob-pub
60+
git push ../bob-pub :
6161
) &&
6262
6363
# Check that the second commit by Alice is not sent
@@ -86,7 +86,7 @@ test_expect_success 'alice works and pushes again' '
8686
cd alice-work &&
8787
echo more alice >file &&
8888
git commit -a -m fourth &&
89-
git push ../alice-pub
89+
git push ../alice-pub :
9090
)
9191
'
9292

@@ -99,7 +99,7 @@ test_expect_success 'bob works and pushes' '
9999
cd bob-work &&
100100
echo yet more bob >file &&
101101
git commit -a -m fifth &&
102-
git push ../bob-pub
102+
git push ../bob-pub :
103103
)
104104
'
105105

@@ -115,7 +115,7 @@ test_expect_success 'alice works and pushes yet again' '
115115
git commit -a -m sixth.2 &&
116116
echo more and more alice >>file &&
117117
git commit -a -m sixth.3 &&
118-
git push ../alice-pub
118+
git push ../alice-pub :
119119
)
120120
'
121121

@@ -136,7 +136,7 @@ test_expect_success 'bob works and pushes again' '
136136
git hash-object -t commit -w commit &&
137137
echo even more bob >file &&
138138
git commit -a -m seventh &&
139-
git push ../bob-pub
139+
git push ../bob-pub :
140140
)
141141
'
142142

t/t5531-deep-submodule-push.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ test_expect_success setup '
1616
(
1717
cd gar/bage &&
1818
git init &&
19+
git config push.default matching &&
1920
>junk &&
2021
git add junk &&
2122
git commit -m "Initial junk"

t/t5550-http-fetch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
1313
start_httpd
1414

1515
test_expect_success 'setup repository' '
16+
git config push.default matching &&
1617
echo content1 >file &&
1718
git add file &&
1819
git commit -m one

t/t5551-http-fetch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'}
1313
start_httpd
1414

1515
test_expect_success 'setup repository' '
16+
git config push.default matching &&
1617
echo content >file &&
1718
git add file &&
1819
git commit -m one

t/t5570-git-daemon.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-5570}
88
start_git_daemon
99

1010
test_expect_success 'setup repository' '
11+
git config push.default matching &&
1112
echo content >file &&
1213
git add file &&
1314
git commit -m one

t/t7406-submodule-update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,14 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir recur
596596
git log > ../../../expected
597597
) &&
598598
git commit -m "added subsubmodule" &&
599-
git push
599+
git push origin :
600600
) &&
601601
(cd .git/modules/deeper/submodule/modules/subsubmodule &&
602602
git log > ../../../../../actual
603603
) &&
604604
git add deeper/submodule &&
605605
git commit -m "update submodule" &&
606-
git push &&
606+
git push origin : &&
607607
test_cmp actual expected
608608
)
609609
'

0 commit comments

Comments
 (0)