add repo caching for non-chan

This commit is contained in:
2023-02-07 00:27:02 -08:00
parent f5f268dff7
commit c2d04ed3b0
6 changed files with 42 additions and 24 deletions

View File

@@ -11,7 +11,10 @@ import (
)
type (
Repo git.Repository
Repo struct {
Repo git.Repository
Path string
}
CommitSet struct {
Commits []types.Commit
Year int
@@ -28,7 +31,7 @@ func OpenRepo(directory string) (Repo, error) {
}
}
r, err := git.PlainOpenWithOptions(directory, &(git.PlainOpenOptions{DetectDotGit: true}))
return Repo(*r), err
return Repo{Repo: *r, Path: directory}, err
}
func GetMRRepos() (RepoSet, error) {