Skip to content

Commit e673e42

Browse files
authored
Fixed issues not updated by commits (#16254)
`UpdateIssuesCommit` may get called with fewer commits because of `FeedMaxCommitNum` and therefore may miss some commands.
1 parent 622f1e7 commit e673e42

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

services/repository/push.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,17 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
193193
}
194194

195195
commits = repo_module.ListToPushCommits(l)
196+
197+
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
198+
log.Error("updateIssuesCommit: %v", err)
199+
}
200+
196201
if len(commits.Commits) > setting.UI.FeedMaxCommitNum {
197202
commits.Commits = commits.Commits[:setting.UI.FeedMaxCommitNum]
198203
}
199204
commits.CompareURL = repo.ComposeCompareURL(opts.OldCommitID, opts.NewCommitID)
200205
notification.NotifyPushCommits(pusher, repo, opts, commits)
201206

202-
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
203-
log.Error("updateIssuesCommit: %v", err)
204-
}
205-
206207
if err = models.RemoveDeletedBranch(repo.ID, branch); err != nil {
207208
log.Error("models.RemoveDeletedBranch %s/%s failed: %v", repo.ID, branch, err)
208209
}

0 commit comments

Comments
 (0)