package rest_test

import (
	"context"
	"testing"

	"github.com/pingcap/agent-git-service/internal/service"
	"github.com/pingcap/agent-git-service/internal/testharness"
)

func writeRepositoryFileFixture(t testing.TB, svc *service.Service, ctx context.Context, fullName, branch, path, message string, content []byte) (string, error) {
	return testharness.WriteRepositoryFile(t, svc, ctx, fullName, branch, path, message, content)
}

func createRepositoryBranchFixture(t testing.TB, svc *service.Service, ctx context.Context, fullName, branch, fromBranch string) error {
	return testharness.CreateRepositoryBranch(t, svc, ctx, fullName, branch, fromBranch)
}

func setRepositoryRefFixture(t testing.TB, svc *service.Service, ctx context.Context, fullName, ref, sha string) error {
	return testharness.SetRepositoryRef(t, svc, ctx, fullName, ref, sha)
}
