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/pending_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/pending_test.go')
| -rw-r--r-- | git-codereview/pending_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/git-codereview/pending_test.go b/git-codereview/pending_test.go index ee5e947..ccb2f76 100644 --- a/git-codereview/pending_test.go +++ b/git-codereview/pending_test.go @@ -22,7 +22,7 @@ func TestPendingNone(t *testing.T) { defer gt.done() testPending(t, ` - master (current branch) + main (current branch) `) } @@ -69,13 +69,13 @@ func TestPendingComplex(t *testing.T) { trun(t, gt.server, "git", "commit", "-a", "-m", "v3") trun(t, gt.client, "git", "fetch") - trun(t, gt.client, "git", "checkout", "-b", "work3ignored", "-t", "origin/master") + trun(t, gt.client, "git", "checkout", "-b", "work3ignored", "-t", "origin/main") write(t, gt.server+"/file", "v4", 0644) trun(t, gt.server, "git", "commit", "-a", "-m", "v4") trun(t, gt.client, "git", "fetch") - trun(t, gt.client, "git", "checkout", "-b", "work2", "-t", "origin/master") + trun(t, gt.client, "git", "checkout", "-b", "work2", "-t", "origin/main") write(t, gt.client+"/file", "modify", 0644) write(t, gt.client+"/file1", "new", 0644) trun(t, gt.client, "git", "add", "file", "file1") @@ -159,14 +159,14 @@ func TestPendingErrors(t *testing.T) { gt.enableGerrit(t) defer gt.done() - trun(t, gt.client, "git", "checkout", "master") + trun(t, gt.client, "git", "checkout", "main") write(t, gt.client+"/file", "v3", 0644) trun(t, gt.client, "git", "commit", "-a", "-m", "v3") testPending(t, ` - master REVHASH..REVHASH (current branch) - ERROR: Branch contains 1 commit not on origin/master. - Do not commit directly to master branch. + main REVHASH..REVHASH (current branch) + ERROR: Branch contains 1 commit not on origin/main. + Do not commit directly to main branch. + REVHASH v3 @@ -177,9 +177,9 @@ func TestPendingErrors(t *testing.T) { `) testPendingArgs(t, []string{"-s"}, ` - master REVHASH..REVHASH (current branch) - ERROR: Branch contains 1 commit not on origin/master. - Do not commit directly to master branch. + main REVHASH..REVHASH (current branch) + ERROR: Branch contains 1 commit not on origin/main. + Do not commit directly to main branch. + REVHASH v3 `) @@ -446,7 +446,7 @@ func TestPendingGerritMultiChange15(t *testing.T) { func testPendingReply(srv *gerritServer, id, rev, status string) { srv.setJSON(id, `{ - "id": "proj~master~`+id+`", + "id": "proj~main~`+id+`", "project": "proj", "current_revision": "`+rev+`", "status": "`+status+`", |
