ref: ab174c473618dd3743881cf44e02c2db4d1ecd5f
dir: /internal/testgit/repo_mktree.go/
package testgit
import (
"testing"
objectid "codeberg.org/lindenii/furgit/object/id"
)
// Mktree creates a tree from textual mktree input and returns its ID.
func (testRepo *TestRepo) Mktree(tb testing.TB, input string) objectid.ObjectID {
tb.Helper()
hex := testRepo.RunInput(tb, []byte(input), "mktree")
id, err := objectid.ParseHex(testRepo.algo, hex)
if err != nil {
tb.Fatalf("parse mktree output %q: %v", hex, err)
}
return id
}