diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-23 17:51:12 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-23 17:51:12 +0800 |
commit | d6619cfe15885b7004585bf2b96933a7a3e51f39 (patch) | |
tree | 0d0fa23ab2014a7289face0f897159b954c44da1 | |
parent | ace20602b554b2d385535dc456395337a5ae5547 (diff) | |
download | gitea-d6619cfe15885b7004585bf2b96933a7a3e51f39.tar.gz gitea-d6619cfe15885b7004585bf2b96933a7a3e51f39.zip |
limit max commits view number on activity
-rw-r--r-- | serve.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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, |