aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testgit')
-rw-r--r--internal/testgit/command.go6
-rw-r--r--internal/testgit/commit.go2
-rw-r--r--internal/testgit/config.go6
-rw-r--r--internal/testgit/fsck.go2
-rw-r--r--internal/testgit/object.go4
-rw-r--r--internal/testgit/refname.go8
-rw-r--r--internal/testgit/repo.go2
-rw-r--r--internal/testgit/show.go2
-rw-r--r--internal/testgit/tree.go2
9 files changed, 17 insertions, 17 deletions
diff --git a/internal/testgit/command.go b/internal/testgit/command.go
index 27fbd321..7f1835ec 100644
--- a/internal/testgit/command.go
+++ b/internal/testgit/command.go
@@ -8,7 +8,7 @@ import (
"testing"
)
-func (repo *Repo) Command(
+func (repo *Repo) command(
tb testing.TB,
command string,
args ...string,
@@ -22,7 +22,7 @@ func (repo *Repo) Command(
return cmd
}
-func (repo *Repo) Run(
+func (repo *Repo) run(
tb testing.TB,
stdin io.Reader,
command string,
@@ -30,7 +30,7 @@ func (repo *Repo) Run(
) (stdout []byte, err error) {
tb.Helper()
- cmd := repo.Command(tb, command, args...)
+ cmd := repo.command(tb, command, args...)
cmd.Stdin = stdin
diff --git a/internal/testgit/commit.go b/internal/testgit/commit.go
index a608d2fa..883db312 100644
--- a/internal/testgit/commit.go
+++ b/internal/testgit/commit.go
@@ -43,7 +43,7 @@ func (repo *Repo) CommitTree(
args = append(args, "-m", opts.Message, "--end-of-options", tree.String())
- cmd := repo.Command(tb, "git", args...)
+ cmd := repo.command(tb, "git", args...)
if opts.Author.Name != "" {
cmd.Env = setEnv(cmd.Env, "GIT_AUTHOR_NAME", opts.Author.Name)
}
diff --git a/internal/testgit/config.go b/internal/testgit/config.go
index 2bbadb74..6ac62b4d 100644
--- a/internal/testgit/config.go
+++ b/internal/testgit/config.go
@@ -5,13 +5,13 @@ import "testing"
func (repo *Repo) ConfigGet(tb testing.TB, key string) (string, error) {
tb.Helper()
- return String(repo.Run(tb, nil, "git", "config", "--get", "--end-of-options", key))
+ return String(repo.run(tb, nil, "git", "config", "--get", "--end-of-options", key))
}
func (repo *Repo) ConfigSet(tb testing.TB, key, value string) error {
tb.Helper()
- _, err := repo.Run(tb, nil, "git", "config", "--end-of-options", key, value)
+ _, err := repo.run(tb, nil, "git", "config", "--end-of-options", key, value)
return err
}
@@ -19,7 +19,7 @@ func (repo *Repo) ConfigSet(tb testing.TB, key, value string) error {
func (repo *Repo) ConfigAdd(tb testing.TB, key, value string) error {
tb.Helper()
- _, err := repo.Run(tb, nil, "git", "config", "--add", "--end-of-options", key, value)
+ _, err := repo.run(tb, nil, "git", "config", "--add", "--end-of-options", key, value)
return err
}
diff --git a/internal/testgit/fsck.go b/internal/testgit/fsck.go
index a1c48026..d32fc3a9 100644
--- a/internal/testgit/fsck.go
+++ b/internal/testgit/fsck.go
@@ -32,7 +32,7 @@ func (repo *Repo) Fsck(tb testing.TB, opts FsckOptions, objects ...id.ObjectID)
args = append(args, object.String())
}
- _, err := repo.Run(tb, nil, "git", args...)
+ _, err := repo.run(tb, nil, "git", args...)
if err != nil {
return fmt.Errorf("fsck: %w", err)
}
diff --git a/internal/testgit/object.go b/internal/testgit/object.go
index 3d6f476c..a01a6ff8 100644
--- a/internal/testgit/object.go
+++ b/internal/testgit/object.go
@@ -15,7 +15,7 @@ import (
func (repo *Repo) HashObject(tb testing.TB, ty typ.Type, body io.Reader) (id.ObjectID, error) {
tb.Helper()
- stdout, err := repo.Run(tb, body, "git", "hash-object", "-t", ty.Name(), "-w", "--stdin", "--literally")
+ stdout, err := repo.run(tb, body, "git", "hash-object", "-t", ty.Name(), "-w", "--stdin", "--literally")
if err != nil {
return id.ObjectID{}, fmt.Errorf("hash-object: %w", err)
}
@@ -33,7 +33,7 @@ func (repo *Repo) HashObject(tb testing.TB, ty typ.Type, body io.Reader) (id.Obj
func (repo *Repo) CatFile(tb testing.TB, ty typ.Type, oid id.ObjectID) ([]byte, error) {
tb.Helper()
- stdout, err := repo.Run(tb, nil, "git", "cat-file", ty.Name(), "--end-of-options", oid.String())
+ stdout, err := repo.run(tb, nil, "git", "cat-file", ty.Name(), "--end-of-options", oid.String())
if err != nil {
return nil, fmt.Errorf("cat-file: %w", err)
}
diff --git a/internal/testgit/refname.go b/internal/testgit/refname.go
index c3d0f9b7..7f547d91 100644
--- a/internal/testgit/refname.go
+++ b/internal/testgit/refname.go
@@ -14,7 +14,7 @@ type RefFormatOptions struct {
func (repo *Repo) CheckRefFormat(tb testing.TB, name string, opts RefFormatOptions) error {
tb.Helper()
- _, err := repo.Run(tb, nil, "git", refFormatArgs("check-ref-format", name, opts)...)
+ _, err := repo.run(tb, nil, "git", refFormatArgs("check-ref-format", name, opts)...)
return err
}
@@ -22,7 +22,7 @@ func (repo *Repo) CheckRefFormat(tb testing.TB, name string, opts RefFormatOptio
func (repo *Repo) NormalizeRefFormat(tb testing.TB, name string, opts RefFormatOptions) (string, error) {
tb.Helper()
- out, err := repo.Run(tb, nil, "git", refFormatArgs("check-ref-format", name, opts, "--normalize")...)
+ out, err := repo.run(tb, nil, "git", refFormatArgs("check-ref-format", name, opts, "--normalize")...)
if err != nil {
return "", err
}
@@ -33,7 +33,7 @@ func (repo *Repo) NormalizeRefFormat(tb testing.TB, name string, opts RefFormatO
func (repo *Repo) CheckBranchName(tb testing.TB, name string) (string, error) {
tb.Helper()
- out, err := repo.Run(tb, nil, "git", "check-ref-format", "--branch", name)
+ out, err := repo.run(tb, nil, "git", "check-ref-format", "--branch", name)
if err != nil {
return "", err
}
@@ -53,7 +53,7 @@ func (repo *Repo) CheckTagName(tb testing.TB, name string) (string, error) {
return "", exec.ErrNotFound
}
- _, err := repo.Run(tb, nil, "git", "check-ref-format", "refs/tags/"+name)
+ _, err := repo.run(tb, nil, "git", "check-ref-format", "refs/tags/"+name)
if err != nil {
return "", err
}
diff --git a/internal/testgit/repo.go b/internal/testgit/repo.go
index 62107f4e..54723360 100644
--- a/internal/testgit/repo.go
+++ b/internal/testgit/repo.go
@@ -40,7 +40,7 @@ func NewRepo(tb testing.TB, opts RepoOptions) (*Repo, error) {
),
}
- return repo, repo.Command(tb, "git", "init", "--object-format="+repo.objectFormat.String(), "--end-of-options", repo.path).Run() //nolint:wrapcheck
+ return repo, repo.command(tb, "git", "init", "--object-format="+repo.objectFormat.String(), "--end-of-options", repo.path).Run() //nolint:wrapcheck
}
func (repo *Repo) ObjectFormat(tb testing.TB) id.ObjectFormat {
diff --git a/internal/testgit/show.go b/internal/testgit/show.go
index 93ecac2c..486b56d5 100644
--- a/internal/testgit/show.go
+++ b/internal/testgit/show.go
@@ -11,7 +11,7 @@ import (
func (repo *Repo) ShowFormat(tb testing.TB, oid id.ObjectID, format string) ([]byte, error) {
tb.Helper()
- stdout, err := repo.Run(tb, nil, "git", "show", "--no-patch", "--no-color", "--format="+format, "--end-of-options", oid.String())
+ stdout, err := repo.run(tb, nil, "git", "show", "--no-patch", "--no-color", "--format="+format, "--end-of-options", oid.String())
if err != nil {
return nil, fmt.Errorf("show --format=%q %s: %w", format, oid, err)
}
diff --git a/internal/testgit/tree.go b/internal/testgit/tree.go
index 3f80d1c3..83febe42 100644
--- a/internal/testgit/tree.go
+++ b/internal/testgit/tree.go
@@ -27,7 +27,7 @@ func (repo *Repo) MkTree(tb testing.TB, entries []MkTreeEntry) (id.ObjectID, err
fmt.Fprintf(&stdin, "%s %s %s\t%s\n", entry.Mode, entry.Type.Name(), entry.OID.String(), entry.Name)
}
- stdout, err := repo.Run(tb, &stdin, "git", "mktree")
+ stdout, err := repo.run(tb, &stdin, "git", "mktree")
if err != nil {
return id.ObjectID{}, fmt.Errorf("mktree: %w", err)
}