ref: cf02f2958c191bea02126faf8daf72a7aae76bd9
dir: /internal/testgit/repo_make_single_file_tree.go/
package testgit
import (
"fmt"
"testing"
"codeberg.org/lindenii/furgit/objectid"
)
// MakeSingleFileTree writes one blob and one tree entry for it and returns (blobID, treeID).
func (testRepo *TestRepo) MakeSingleFileTree(tb testing.TB, fileName string, fileContent []byte) (objectid.ObjectID, objectid.ObjectID) {
tb.Helper()
blobID := testRepo.HashObject(tb, "blob", fileContent)
treeInput := fmt.Sprintf("100644 blob %s\t%s\n", blobID.String(), fileName)
treeID := testRepo.Mktree(tb, treeInput)
return blobID, treeID
}