aboutsummaryrefslogtreecommitdiff
path: root/pkg/service/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/service/git.go')
-rw-r--r--pkg/service/git.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/service/git.go b/pkg/service/git.go
index 614770f..57b9b6e 100644
--- a/pkg/service/git.go
+++ b/pkg/service/git.go
@@ -5,6 +5,7 @@ import (
"git.gabrielgio.me/cerrado/pkg/config"
"git.gabrielgio.me/cerrado/pkg/git"
+ "github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
)
@@ -65,3 +66,19 @@ func (g *GitService) ListCommits(name string) ([]*object.Commit, error) {
repo := git.NewGitRepository(r.Path)
return repo.Commits()
}
+
+func (g *GitService) ListTags(name string) ([]*object.Tag, error) {
+ // TODO: handle nil
+ r := g.configRepo.GetByName(name)
+
+ repo := git.NewGitRepository(r.Path)
+ return repo.Tags()
+}
+
+func (g *GitService) ListBranches(name string) ([]*plumbing.Reference, error) {
+ // TODO: handle nil
+ r := g.configRepo.GetByName(name)
+
+ repo := git.NewGitRepository(r.Path)
+ return repo.Branches()
+}