mirror of
https://github.com/go-gitea/gitea.git
synced 2024-10-29 08:17:31 -04:00
Merge pull request #494 from compressed/gt_2_commits
Increase max commits in payload to 5
This commit is contained in:
commit
01e69af2c8
@ -23,6 +23,10 @@ type UpdateTask struct {
|
|||||||
NewCommitId string
|
NewCommitId string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
MAX_COMMITS int = 5
|
||||||
|
)
|
||||||
|
|
||||||
func AddUpdateTask(task *UpdateTask) error {
|
func AddUpdateTask(task *UpdateTask) error {
|
||||||
_, err := x.Insert(task)
|
_, err := x.Insert(task)
|
||||||
return err
|
return err
|
||||||
@ -132,7 +136,6 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
|
|||||||
|
|
||||||
// if commits push
|
// if commits push
|
||||||
commits := make([]*base.PushCommit, 0)
|
commits := make([]*base.PushCommit, 0)
|
||||||
var maxCommits = 2
|
|
||||||
var actEmail string
|
var actEmail string
|
||||||
for e := l.Front(); e != nil; e = e.Next() {
|
for e := l.Front(); e != nil; e = e.Next() {
|
||||||
commit := e.Value.(*git.Commit)
|
commit := e.Value.(*git.Commit)
|
||||||
@ -145,7 +148,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
|
|||||||
commit.Message(),
|
commit.Message(),
|
||||||
commit.Author.Email,
|
commit.Author.Email,
|
||||||
commit.Author.Name})
|
commit.Author.Name})
|
||||||
if len(commits) >= maxCommits {
|
if len(commits) >= MAX_COMMITS {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user