]> source.dussan.org Git - gitea.git/commitdiff
limit max commits view number on activity
authorLunny Xiao <xiaolunwen@gmail.com>
Sun, 23 Mar 2014 09:51:12 +0000 (17:51 +0800)
committerLunny Xiao <xiaolunwen@gmail.com>
Sun, 23 Mar 2014 09:51:12 +0000 (17:51 +0800)
serve.go

index bb9165dc06af1e129081ac715d836f80837caf0c..812c37bb58048c73b658caa2e261fba7ea95415a 100644 (file)
--- a/serve.go
+++ b/serve.go
@@ -262,9 +262,13 @@ func runServ(k *cli.Context) {
        }
 
        commits := make([][]string, 0)
+       var maxCommits = 5
        for e := l.Back(); e != nil; e = e.Prev() {
                commit := e.Value.(*git.Commit)
                commits = append(commits, []string{commit.Id().String(), commit.Message()})
+               if len(commits) >= maxCommits {
+                       break
+               }
        }
 
        if err = models.CommitRepoAction(user.Id, user.Name,