From 33a18dcc749b3f0f3e32a609527f64b5a3c3d696 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 24 May 2026 11:19:39 +0000 Subject: internal/testgit: Lint --- internal/testgit/repo.go | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'internal/testgit') diff --git a/internal/testgit/repo.go b/internal/testgit/repo.go index 54330906..69a6c66b 100644 --- a/internal/testgit/repo.go +++ b/internal/testgit/repo.go @@ -14,23 +14,6 @@ type Repo struct { env []string } -func (repo *Repo) ObjectFormat() id.ObjectFormat { - return repo.objectFormat -} - -func (repo *Repo) Command( - tb testing.TB, - command string, - args ...string, -) *exec.Cmd { - //nolint:noctx - cmd := exec.Command(command, args...) - cmd.Dir = repo.path - cmd.Env = repo.env - - return cmd -} - type RepoOptions struct { ObjectFormat id.ObjectFormat } @@ -53,5 +36,24 @@ func NewRepo(tb testing.TB, opts RepoOptions) (*Repo, error) { ), } - return repo, repo.Command(tb, "git", "init", "--object-format="+repo.objectFormat.String(), "--", repo.path).Run() + return repo, repo.Command(tb, "git", "init", "--object-format="+repo.objectFormat.String(), "--", repo.path).Run() //nolint:wrapcheck +} + +func (repo *Repo) ObjectFormat() id.ObjectFormat { + return repo.objectFormat +} + +func (repo *Repo) Command( + tb testing.TB, + command string, + args ...string, +) *exec.Cmd { + tb.Helper() + + //nolint:noctx + cmd := exec.Command(command, args...) + cmd.Dir = repo.path + cmd.Env = repo.env + + return cmd } -- cgit v1.3.1-10-gc9f91