1package backend23import (4 "github.com/charmbracelet/soft-serve/git"5 "github.com/charmbracelet/soft-serve/pkg/proto"6)78// LatestFile returns the contents of the latest file at the specified path in9// the repository and its file path.10func LatestFile(r proto.Repository, ref *git.Reference, pattern string) (string, string, error) {11 repo, err := r.Open()12 if err != nil {13 return "", "", err14 }15 return git.LatestFile(repo, ref, pattern)16}1718// Readme returns the repository's README.19func Readme(r proto.Repository, ref *git.Reference) (readme string, path string, err error) {20 pattern := "[rR][eE][aA][dD][mM][eE]*"21 readme, path, err = LatestFile(r, ref, pattern)22 return23}