aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit/repo_run.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-20 22:59:14 +0800
committerGravatar Runxi Yu2026-02-20 22:59:14 +0800
commitd88c8e20aebd9408df0306e97dffc2896950342d (patch)
tree8e137f37fdd9ea673bd622a2b9c9873cd89278fb /internal/testgit/repo_run.go
parentobjectid: Use _test package for tests (diff)
signatureNo signature
*: Replace repo with testRepo
Diffstat (limited to 'internal/testgit/repo_run.go')
-rw-r--r--internal/testgit/repo_run.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/testgit/repo_run.go b/internal/testgit/repo_run.go
index 66222569..aafcc923 100644
--- a/internal/testgit/repo_run.go
+++ b/internal/testgit/repo_run.go
@@ -8,36 +8,36 @@ import (
)
// Run executes git and returns trimmed textual output.
-func (repo *TestRepo) Run(tb testing.TB, args ...string) string {
+func (testRepo *TestRepo) Run(tb testing.TB, args ...string) string {
tb.Helper()
- out := repo.runBytes(tb, nil, repo.dir, args...)
+ out := testRepo.runBytes(tb, nil, testRepo.dir, args...)
return strings.TrimSpace(string(out))
}
// RunBytes executes git and returns raw output bytes.
-func (repo *TestRepo) RunBytes(tb testing.TB, args ...string) []byte {
+func (testRepo *TestRepo) RunBytes(tb testing.TB, args ...string) []byte {
tb.Helper()
- return repo.runBytes(tb, nil, repo.dir, args...)
+ return testRepo.runBytes(tb, nil, testRepo.dir, args...)
}
// RunInput executes git with stdin and returns trimmed textual output.
-func (repo *TestRepo) RunInput(tb testing.TB, stdin []byte, args ...string) string {
+func (testRepo *TestRepo) RunInput(tb testing.TB, stdin []byte, args ...string) string {
tb.Helper()
- out := repo.runBytes(tb, stdin, repo.dir, args...)
+ out := testRepo.runBytes(tb, stdin, testRepo.dir, args...)
return strings.TrimSpace(string(out))
}
// RunInputBytes executes git with stdin and returns raw output bytes.
-func (repo *TestRepo) RunInputBytes(tb testing.TB, stdin []byte, args ...string) []byte {
+func (testRepo *TestRepo) RunInputBytes(tb testing.TB, stdin []byte, args ...string) []byte {
tb.Helper()
- return repo.runBytes(tb, stdin, repo.dir, args...)
+ return testRepo.runBytes(tb, stdin, testRepo.dir, args...)
}
-func (repo *TestRepo) runBytes(tb testing.TB, stdin []byte, dir string, args ...string) []byte {
+func (testRepo *TestRepo) runBytes(tb testing.TB, stdin []byte, dir string, args ...string) []byte {
tb.Helper()
cmd := exec.Command("git", args...)
cmd.Dir = dir
- cmd.Env = repo.env
+ cmd.Env = testRepo.env
if stdin != nil {
cmd.Stdin = bytes.NewReader(stdin)
}