···
commits := []*object.Commit{}
output, err := g.revList(
fmt.Sprintf("--skip=%d", offset),
fmt.Sprintf("--max-count=%d", limit),
···
func (g *GitRepo) TotalCommits() (int, error) {
output, err := g.revList(
···
func (g *GitRepo) revList(extraArgs ...string) ([]byte, error) {
args = append(args, "rev-list")
-
args = append(args, g.h.String())
args = append(args, extraArgs...)
cmd := exec.Command("git", args...)
func (g *GitRepo) Commit(h plumbing.Hash) (*object.Commit, error) {
···
commits := []*object.Commit{}
output, err := g.revList(
fmt.Sprintf("--skip=%d", offset),
fmt.Sprintf("--max-count=%d", limit),
···
func (g *GitRepo) TotalCommits() (int, error) {
output, err := g.revList(
···
func (g *GitRepo) revList(extraArgs ...string) ([]byte, error) {
args = append(args, "rev-list")
args = append(args, extraArgs...)
cmd := exec.Command("git", args...)
+
out, err := cmd.Output()
+
if exitErr, ok := err.(*exec.ExitError); ok {
+
return nil, fmt.Errorf("%w, stderr: %s", err, string(exitErr.Stderr))
func (g *GitRepo) Commit(h plumbing.Hash) (*object.Commit, error) {