Skip to content

Commit

Permalink
Fixed issues not updated by commits (go-gitea#16254) (go-gitea#16261)
Browse files Browse the repository at this point in the history
`UpdateIssuesCommit` may get called with fewer commits because of `FeedMaxCommitNum` and therefore may miss some commands.
  • Loading branch information
KN4CK3R authored Jun 26, 2021
1 parent b935472 commit 8778263
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions services/repository/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,17 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
}

commits = repo_module.ListToPushCommits(l)

if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
log.Error("updateIssuesCommit: %v", err)
}

if len(commits.Commits) > setting.UI.FeedMaxCommitNum {
commits.Commits = commits.Commits[:setting.UI.FeedMaxCommitNum]
}
commits.CompareURL = repo.ComposeCompareURL(opts.OldCommitID, opts.NewCommitID)
notification.NotifyPushCommits(pusher, repo, opts, commits)

if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
log.Error("updateIssuesCommit: %v", err)
}

if err = models.RemoveDeletedBranch(repo.ID, branch); err != nil {
log.Error("models.RemoveDeletedBranch %s/%s failed: %v", repo.ID, branch, err)
}
Expand Down

0 comments on commit 8778263

Please sign in to comment.