Skip to content

Commit 5e21331

Browse files
committed
Make max commits in graph configurable
1 parent ae9dd23 commit 5e21331

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

models/graph.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010

1111
"code.gitea.io/git"
12+
"code.gitea.io/gitea/modules/setting"
1213
)
1314

1415
// GraphItem represent one commit, or one relation in timeline
@@ -41,7 +42,7 @@ func GetCommitGraph(r *git.Repository) (GraphItems, error) {
4142
"--all",
4243
"-C",
4344
"-M",
44-
"-n 100",
45+
fmt.Sprintf("-n %d", setting.UI.GraphMaxCommitNum),
4546
"--date=iso",
4647
fmt.Sprintf("--pretty=format:%s", format),
4748
)

modules/setting/setting.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ var (
276276
IssuePagingNum int
277277
RepoSearchPagingNum int
278278
FeedMaxCommitNum int
279+
GraphMaxCommitNum int
279280
ReactionMaxUserNum int
280281
ThemeColorMetaTag string
281282
MaxDisplayFileSize int64
@@ -301,6 +302,7 @@ var (
301302
IssuePagingNum: 10,
302303
RepoSearchPagingNum: 10,
303304
FeedMaxCommitNum: 5,
305+
GraphMaxCommitNum: 100,
304306
ReactionMaxUserNum: 10,
305307
ThemeColorMetaTag: `#6cc644`,
306308
MaxDisplayFileSize: 8388608,

0 commit comments

Comments
 (0)