From cb9036aab96895ddf03cab68f75d3356f5227968 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 26 Jan 2025 14:53:14 +0100 Subject: feat: Add log pagination Now it is possible to navigate through all commit from a given repository. It implements a simple navigation which will plenty for now. --- pkg/service/git.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/service') diff --git a/pkg/service/git.go b/pkg/service/git.go index 12d238e..2d00715 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -81,22 +81,22 @@ func (g *GitService) ListRepositories() ([]*Repository, error) { return repos, nil } -func (g *GitService) ListCommits(name, ref string, count int) ([]*object.Commit, error) { +func (g *GitService) ListCommits(name, ref, from string, count int) ([]*object.Commit, *object.Commit, error) { r := g.configRepo.GetByName(name) if r == nil { - return nil, ErrRepositoryNotFound + return nil, nil, ErrRepositoryNotFound } repo, err := git.OpenRepository(r.Path) if err != nil { - return nil, err + return nil, nil, err } err = repo.SetRef(ref) if err != nil { - return nil, err + return nil, nil, err } - return repo.Commits(count) + return repo.Commits(count, from) } func (g *GitService) LastCommit(name, ref string) (*object.Commit, error) { -- cgit v1.2.3