Skip to content

Commit 9b3cdf5

Browse files
author
Simon Prochazka
committed
fix: CommitOnBranch failing when end of commits reached
- in situations where GIT_DEPTH is set CommitsOnBranch would fail and not return all commits it got
1 parent 56d33a3 commit 9b3cdf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/history/commits_on_branch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package history
22

33
import (
44
"errors"
5+
"log"
56

67
"gopkg.in/src-d/go-git.v4"
78
"gopkg.in/src-d/go-git.v4/plumbing"
@@ -32,7 +33,9 @@ func (g *Git) CommitsOnBranch(
3233
})
3334

3435
if branchIterErr != nil {
35-
return nil, branchIterErr
36+
if g.Debug {
37+
log.Printf("Stopped getting commits on branch: %v", branchIterErr)
38+
}
3639
}
3740

3841
return branchCommits, nil

0 commit comments

Comments
 (0)