diff options
| author | 2026-03-04 08:26:56 +0800 | |
|---|---|---|
| committer | 2026-03-04 08:59:53 +0800 | |
| commit | ab7501be34032fb9e5c48726a68ae90a917af9eb (patch) | |
| tree | 20d005647569befea8133e953c3270e8fd2a2a5b /internal/testgit/repo_commit_tree.go | |
| parent | *: gofumpt (diff) | |
| signature | No signature | |
*: Lint
Diffstat (limited to 'internal/testgit/repo_commit_tree.go')
| -rw-r--r-- | internal/testgit/repo_commit_tree.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/testgit/repo_commit_tree.go b/internal/testgit/repo_commit_tree.go index 763474c2..5eee21ba 100644 --- a/internal/testgit/repo_commit_tree.go +++ b/internal/testgit/repo_commit_tree.go @@ -9,16 +9,21 @@ import ( // CommitTree creates a commit from a tree and message, optionally with parents. func (testRepo *TestRepo) CommitTree(tb testing.TB, tree objectid.ObjectID, message string, parents ...objectid.ObjectID) objectid.ObjectID { tb.Helper() + args := make([]string, 0, 2+2*len(parents)+2) + args = append(args, "commit-tree", tree.String()) for _, p := range parents { args = append(args, "-p", p.String()) } + args = append(args, "-m", message) hex := testRepo.Run(tb, args...) + id, err := objectid.ParseHex(testRepo.algo, hex) if err != nil { tb.Fatalf("parse commit-tree output %q: %v", hex, err) } + return id } |
