From 27400b0fce5d4ef3b7fd5ef4d25bac8f00754e33 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sat, 15 Feb 2025 17:33:24 +0100 Subject: feat: Add wrapper for commit Add a wrapper to the commit log that also contains possible reference. This will be useful once to later display the reference in the commit log. --- pkg/service/git.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/service') diff --git a/pkg/service/git.go b/pkg/service/git.go index 773d335..8642b5b 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -18,7 +18,7 @@ type ( Name string Description string Public bool - LastCommit *object.Commit + LastCommit *git.CommitReference Ref string } @@ -81,7 +81,7 @@ func (g *GitService) ListRepositories() ([]*Repository, error) { return repos, nil } -func (g *GitService) ListCommits(name, ref, from string, count int) ([]*object.Commit, *object.Commit, error) { +func (g *GitService) ListCommits(name, ref, from string, count int) ([]*git.CommitReference, *object.Commit, error) { r := g.configRepo.GetByName(name) if r == nil { return nil, nil, ErrRepositoryNotFound @@ -99,7 +99,7 @@ func (g *GitService) ListCommits(name, ref, from string, count int) ([]*object.C return repo.Commits(count, from) } -func (g *GitService) LastCommit(name, ref string) (*object.Commit, error) { +func (g *GitService) LastCommit(name, ref string) (*git.CommitReference, error) { r := g.configRepo.GetByName(name) if r == nil { return nil, ErrRepositoryNotFound -- cgit v1.2.3