Skip to content

Commit 95228b7

Browse files
committed
fix: fill head commit in payload
1 parent 7a5af25 commit 95228b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: services/mirror/mirror_pull.go

+7
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,13 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool {
499499
theCommits.Commits = theCommits.Commits[:setting.UI.FeedMaxCommitNum]
500500
}
501501

502+
if newCommit, err := gitRepo.GetCommit(newCommitID); err != nil {
503+
log.Error("SyncMirrors [repo: %-v]: unable to get GetCommit [%s]: %v", m.Repo, newCommitID, err)
504+
continue
505+
} else {
506+
theCommits.HeadCommit = repo_module.CommitToPushCommit(newCommit)
507+
}
508+
502509
theCommits.CompareURL = m.Repo.ComposeCompareURL(oldCommitID, newCommitID)
503510

504511
notification.NotifySyncPushCommits(ctx, m.Repo.MustOwner(ctx), m.Repo, &repo_module.PushUpdateOptions{

0 commit comments

Comments
 (0)