aboutsummaryrefslogtreecommitdiff
path: root/pkg/service
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2025-01-26 14:53:14 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2025-01-26 14:54:52 +0100
commitcb9036aab96895ddf03cab68f75d3356f5227968 (patch)
treebc97024b0e947a0624579552955ce7c1ea47c572 /pkg/service
parentf128f0a029430cb5ab4f89733d8297666a6b2fdf (diff)
downloadcerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.tar.gz
cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.tar.bz2
cerrado-c51e2ae8af53a544cb6aa0bdc4713cb9571ba304.zip
feat: Add log paginationHEADv0.0.19master
Now it is possible to navigate through all commit from a given repository. It implements a simple navigation which will plenty for now.
Diffstat (limited to 'pkg/service')
-rw-r--r--pkg/service/git.go10
1 files changed, 5 insertions, 5 deletions
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) {