parent
3083522620
commit
086bfb8b4b
4 changed files with 8 additions and 4 deletions
|
@ -30,7 +30,7 @@ type GraphItem struct {
|
|||
type GraphItems []GraphItem
|
||||
|
||||
// GetCommitGraph return a list of commit (GraphItems) from all branches
|
||||
func GetCommitGraph(r *git.Repository) (GraphItems, error) {
|
||||
func GetCommitGraph(r *git.Repository, page int) (GraphItems, error) {
|
||||
|
||||
var CommitGraph []GraphItem
|
||||
|
||||
|
@ -43,6 +43,7 @@ func GetCommitGraph(r *git.Repository) (GraphItems, error) {
|
|||
"-C",
|
||||
"-M",
|
||||
fmt.Sprintf("-n %d", setting.UI.GraphMaxCommitNum),
|
||||
fmt.Sprintf("--skip=%d", setting.UI.GraphMaxCommitNum*(page-1)),
|
||||
"--date=iso",
|
||||
fmt.Sprintf("--pretty=format:%s", format),
|
||||
)
|
||||
|
|
|
@ -19,7 +19,7 @@ func BenchmarkGetCommitGraph(b *testing.B) {
|
|||
}
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
graph, err := GetCommitGraph(currentRepo)
|
||||
graph, err := GetCommitGraph(currentRepo, 1)
|
||||
if err != nil {
|
||||
b.Error("Could get commit graph")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue