summaryrefslogtreecommitdiffstats
path: root/models/update.go
diff options
context:
space:
mode:
authorChristopher Brickley <brickley@gmail.com>2014-09-22 08:25:39 -0400
committerChristopher Brickley <brickley@gmail.com>2014-09-22 08:25:39 -0400
commit25c8d01676217ab37e117a2aefb77ff4aeed4448 (patch)
tree8930cd15bc461fc19c32f01de86c4c0eb4c79b1b /models/update.go
parent7df60af60ed6d9606c5894c6512522dc91d0c247 (diff)
downloadgitea-25c8d01676217ab37e117a2aefb77ff4aeed4448.tar.gz
gitea-25c8d01676217ab37e117a2aefb77ff4aeed4448.zip
increase max commits in payload to 5
Diffstat (limited to 'models/update.go')
-rw-r--r--models/update.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/models/update.go b/models/update.go
index ec6a979016..d939a90874 100644
--- a/models/update.go
+++ b/models/update.go
@@ -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
}
}