]> source.dussan.org Git - gitea.git/commitdiff
increase max commits in payload to 5
authorChristopher Brickley <brickley@gmail.com>
Mon, 22 Sep 2014 12:25:39 +0000 (08:25 -0400)
committerChristopher Brickley <brickley@gmail.com>
Mon, 22 Sep 2014 12:25:39 +0000 (08:25 -0400)
models/update.go

index ec6a9790169a79337a24c2adfbd7f52854dbfea9..d939a90874dbd7def0e54bf2bb9d28f63ab14d4c 100644 (file)
@@ -23,6 +23,10 @@ type UpdateTask struct {
        NewCommitId string
 }
 
+const (
+       MAX_COMMITS int = 5
+)
+
 func AddUpdateTask(task *UpdateTask) error {
        _, err := x.Insert(task)
        return err
@@ -132,7 +136,6 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
 
        // if commits push
        commits := make([]*base.PushCommit, 0)
-       var maxCommits = 2
        var actEmail string
        for e := l.Front(); e != nil; e = e.Next() {
                commit := e.Value.(*git.Commit)
@@ -145,7 +148,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
                                commit.Message(),
                                commit.Author.Email,
                                commit.Author.Name})
-               if len(commits) >= maxCommits {
+               if len(commits) >= MAX_COMMITS {
                        break
                }
        }