diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-01-26 14:53:14 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-01-26 14:54:52 +0100 |
commit | cb9036aab96895ddf03cab68f75d3356f5227968 (patch) | |
tree | bc97024b0e947a0624579552955ce7c1ea47c572 /pkg/service | |
parent | f128f0a029430cb5ab4f89733d8297666a6b2fdf (diff) | |
download | cerrado-0.0.19.tar.gz cerrado-0.0.19.tar.bz2 cerrado-0.0.19.zip |
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.go | 10 |
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) { |