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/gofmt_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/gofmt_test.go')
| -rw-r--r-- | git-codereview/gofmt_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/git-codereview/gofmt_test.go b/git-codereview/gofmt_test.go index 0bd6aa9..81f82a4 100644 --- a/git-codereview/gofmt_test.go +++ b/git-codereview/gofmt_test.go @@ -255,33 +255,33 @@ func TestGofmtFastForwardMerge(t *testing.T) { gt := newGitTest(t) defer gt.done() - // merge dev.branch into master + // merge dev.branch into main write(t, gt.server+"/file", "more work", 0644) trun(t, gt.server, "git", "commit", "-m", "work", "file") trun(t, gt.server, "git", "merge", "-m", "merge", "dev.branch") - // add bad go file on master + // add bad go file on main write(t, gt.server+"/bad.go", "package {\n", 0644) trun(t, gt.server, "git", "add", "bad.go") trun(t, gt.server, "git", "commit", "-m", "bad go") // update client - trun(t, gt.client, "git", "checkout", "master") + trun(t, gt.client, "git", "checkout", "main") trun(t, gt.client, "git", "pull") testMain(t, "change", "dev.branch") trun(t, gt.client, "git", "pull") - // merge master into dev.branch, fast forward merge - trun(t, gt.client, "git", "merge", "--ff-only", "master") + // merge main into dev.branch, fast forward merge + trun(t, gt.client, "git", "merge", "--ff-only", "main") // verify that now client is in a state where just the tag is changing; there's no new commit. - masterHash := strings.TrimSpace(trun(t, gt.server, "git", "rev-parse", "master")) + mainHash := strings.TrimSpace(trun(t, gt.server, "git", "rev-parse", "main")) devHash := strings.TrimSpace(trun(t, gt.client, "git", "rev-parse", "HEAD")) - if masterHash != devHash { + if mainHash != devHash { t.Logf("branches:\n%s", trun(t, gt.client, "git", "branch", "-a", "-v")) t.Logf("log:\n%s", trun(t, gt.client, "git", "log", "--graph", "--decorate")) - t.Fatalf("setup wrong - got different commit hashes on master and dev branch") + t.Fatalf("setup wrong - got different commit hashes on main and dev branch") } // check that gofmt finds nothing to do, ignoring the bad (but committed) file1.go. |
