diff options
| author | 2026-06-06 16:31:02 +0000 | |
|---|---|---|
| committer | 2026-06-06 16:31:02 +0000 | |
| commit | e083d4dc1f455bd57b2f9d473fb44f5ee5ccbbe3 (patch) | |
| tree | 65227398b7db087a7aff211daa4000715bda399c /internal/testgit/object.go | |
| parent | testgit sucks (diff) | |
| signature | No signature | |
internal/testgit: hash-object and command
Diffstat (limited to 'internal/testgit/object.go')
| -rw-r--r-- | internal/testgit/object.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/testgit/object.go b/internal/testgit/object.go index a46ef02b..6f1a2dd8 100644 --- a/internal/testgit/object.go +++ b/internal/testgit/object.go @@ -12,16 +12,15 @@ import ( // and returns its object ID. func (repo *Repo) HashObject(tb testing.TB, ty typ.Type, body io.Reader) id.ObjectID { tb.Helper() - cmd := repo.Command(tb, "git", "hash-object", "-t", ty.Name(), "-w", "--stdin", "--literally") - hex, err := cmd.CombinedOutput() + stdout, err := repo.Run(tb, body, "git", "hash-object", "-t", ty.Name(), "-w", "--stdin", "--literally") if err != nil { - tb.Fatalf("hash-object: %v", hex) + tb.Fatalf("hash-object: %v", err) } - id, err := repo.objectFormat.FromString(string(hex)) + id, err := repo.objectFormat.FromString(string(stdout)) if err != nil { - tb.Fatalf("parse git hash-object output %q: %v", hex, err) + tb.Fatalf("parse git hash-object output %q: %v", string(stdout), err) } return id |
