diff options
| author | Russ Cox <rsc@golang.org> | 2021-01-07 12:26:06 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-01-07 17:26:24 +0000 |
| commit | 541f6aec3b30c1bd064ea95cdaaf57f4e65bef4d (patch) | |
| tree | 660810907f7bd23d80f421446509fb685d041b59 /git-codereview/mail_test.go | |
| parent | 9593f86427dedbe2eda472886bd2a4f8c965abf5 (diff) | |
| download | go-x-review-541f6aec3b30c1bd064ea95cdaaf57f4e65bef4d.tar.xz | |
git-codereview: update tests for "main" branch default
"git init ." leaves me on "main" now, not "master".
Update tests to expect that, and update the "tracking" message too
(otherwise the tests fail).
Because not all gits agree about the initial branch name,
set it explicitly too in the test.
Fixes #42926.
Change-Id: If3adb3bb53beba9efcd75cad0f081f59fba85fe7
Reviewed-on: https://go-review.googlesource.com/c/review/+/279873
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'git-codereview/mail_test.go')
| -rw-r--r-- | git-codereview/mail_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/git-codereview/mail_test.go b/git-codereview/mail_test.go index c655b54..b754d3b 100644 --- a/git-codereview/mail_test.go +++ b/git-codereview/mail_test.go @@ -26,7 +26,7 @@ func TestMail(t *testing.T) { testMain(t, "mail") testRan(t, - "git push -q origin HEAD:refs/for/master", + "git push -q origin HEAD:refs/for/main", "git tag -f work.mailed "+h) } @@ -153,14 +153,14 @@ func TestMailMultiple(t *testing.T) { h := CurrentBranch().Pending()[1].ShortHash testMain(t, "mail", "HEAD^") testRan(t, - "git push -q origin "+h+":refs/for/master", + "git push -q origin "+h+":refs/for/main", "git tag -f work.mailed "+h) // Mail HEAD. h = CurrentBranch().Pending()[0].ShortHash testMain(t, "mail", "HEAD") testRan(t, - "git push -q origin HEAD:refs/for/master", + "git push -q origin HEAD:refs/for/main", "git tag -f work.mailed "+h) } @@ -203,17 +203,17 @@ func TestMailShort(t *testing.T) { testMain(t, "mail") testRan(t, - "git push -q origin HEAD:refs/for/master", + "git push -q origin HEAD:refs/for/main", "git tag -f work.mailed "+h) testMain(t, "mail", "-r", "r1") testRan(t, - "git push -q origin HEAD:refs/for/master%r=r1@golang.org", + "git push -q origin HEAD:refs/for/main%r=r1@golang.org", "git tag -f work.mailed "+h) testMain(t, "mail", "-r", "other,anon", "-cc", "r1,full@email.com") testRan(t, - "git push -q origin HEAD:refs/for/master%r=other@golang.org,r=anon@golang.org,cc=r1@golang.org,cc=full@email.com", + "git push -q origin HEAD:refs/for/main%r=other@golang.org,r=anon@golang.org,cc=r1@golang.org,cc=full@email.com", "git tag -f work.mailed "+h) testMainDied(t, "mail", "-r", "other", "-r", "anon,r1,missing") @@ -229,7 +229,7 @@ func TestWIP(t *testing.T) { testMain(t, "mail", "-wip") testRan(t, - "git push -q origin HEAD:refs/for/master%wip", + "git push -q origin HEAD:refs/for/main%wip", "git tag -f work.mailed "+h) } @@ -253,7 +253,7 @@ func TestMailTopic(t *testing.T) { testMain(t, "mail", "-topic", "test-topic") testRan(t, - "git push -q origin HEAD:refs/for/master%topic=test-topic", + "git push -q origin HEAD:refs/for/main%topic=test-topic", "git tag -f work.mailed "+h) } @@ -274,11 +274,11 @@ func TestMailHashtag(t *testing.T) { testMain(t, "mail", "-hashtag", "test1,test2") testRan(t, - "git push -q origin HEAD:refs/for/master%hashtag=test1,hashtag=test2", + "git push -q origin HEAD:refs/for/main%hashtag=test1,hashtag=test2", "git tag -f work.mailed "+h) testMain(t, "mail", "-hashtag", "") testRan(t, - "git push -q origin HEAD:refs/for/master", + "git push -q origin HEAD:refs/for/main", "git tag -f work.mailed "+h) testMainDied(t, "mail", "-hashtag", "test1,,test3") @@ -299,7 +299,7 @@ func TestMailEmpty(t *testing.T) { testMain(t, "change", "work") testRan(t, "git checkout -q -b work", - "git branch -q --set-upstream-to origin/master") + "git branch -q --set-upstream-to origin/main") t.Logf("creating empty change") testCommitMsg = "foo: this commit will be empty" |
