diff options
Diffstat (limited to 'pkg/service/git.go')
-rw-r--r-- | pkg/service/git.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/service/git.go b/pkg/service/git.go index 2165abe..6bb6e9e 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -128,6 +128,24 @@ func (g *GitService) GetFileContent(name, ref, path string) (string, error) { return repo.FileContent(path) } +func (g *GitService) GetAbout(name string) (string, error) { + r := g.configRepo.GetByName(name) + if r == nil { + return "", RepositoryNotFoundErr + } + + repo, err := git.OpenRepository(r.Path) + if err != nil { + return "", err + } + err = repo.SetRef("") + if err != nil { + return "", err + } + + return repo.FileContent(r.About) +} + func (g *GitService) ListTags(name string) ([]*plumbing.Reference, error) { r := g.configRepo.GetByName(name) if r == nil { |