aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testgit')
-rw-r--r--internal/testgit/repo.go38
1 files changed, 20 insertions, 18 deletions
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
}