From 37788b8b9eef420903006489360e64684e2c54a7 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 6 Sep 2023 11:31:56 +0200 Subject: [PATCH] cmd/go: remove unused (*testgoData).runGit test helper It's unused since CL 518775. Change-Id: I81a4865d0c656ca2b968d51e52388c88e661a157 Reviewed-on: https://go-review.googlesource.com/c/go/+/537595 Reviewed-by: Bryan Mills LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- src/cmd/go/go_test.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 3cb6131e8c..1c4374da4b 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -579,31 +579,6 @@ func (tg *testgoData) runFail(args ...string) { } } -// runGit runs a git command, and expects it to succeed. -func (tg *testgoData) runGit(dir string, args ...string) { - tg.t.Helper() - cmd := testenv.Command(tg.t, "git", args...) - tg.stdout.Reset() - tg.stderr.Reset() - cmd.Stdout = &tg.stdout - cmd.Stderr = &tg.stderr - cmd.Dir = dir - cmd.Env = tg.env - status := cmd.Run() - if tg.stdout.Len() > 0 { - tg.t.Log("git standard output:") - tg.t.Log(tg.stdout.String()) - } - if tg.stderr.Len() > 0 { - tg.t.Log("git standard error:") - tg.t.Log(tg.stderr.String()) - } - if status != nil { - tg.t.Logf("git %v failed unexpectedly: %v", args, status) - tg.t.FailNow() - } -} - // getStdout returns standard output of the testgo run as a string. func (tg *testgoData) getStdout() string { tg.t.Helper() -- 2.44.0