From 95228b73068031a325c458501a74bdf73e759227 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 1 Mar 2023 17:29:54 +0800 Subject: [PATCH 1/2] fix: fill head commit in payload --- services/mirror/mirror_pull.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go index 126d2bf354682..54e57f9b99d0d 100644 --- a/services/mirror/mirror_pull.go +++ b/services/mirror/mirror_pull.go @@ -499,6 +499,13 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool { theCommits.Commits = theCommits.Commits[:setting.UI.FeedMaxCommitNum] } + if newCommit, err := gitRepo.GetCommit(newCommitID); err != nil { + log.Error("SyncMirrors [repo: %-v]: unable to get GetCommit [%s]: %v", m.Repo, newCommitID, err) + continue + } else { + theCommits.HeadCommit = repo_module.CommitToPushCommit(newCommit) + } + theCommits.CompareURL = m.Repo.ComposeCompareURL(oldCommitID, newCommitID) notification.NotifySyncPushCommits(ctx, m.Repo.MustOwner(ctx), m.Repo, &repo_module.PushUpdateOptions{ From 7a75d96752f918b809165a5c649d88f3d4fd9e7d Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sat, 4 Mar 2023 08:17:50 +0800 Subject: [PATCH 2/2] Update services/mirror/mirror_pull.go Co-authored-by: delvh --- services/mirror/mirror_pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go index 54e57f9b99d0d..60699294c18bd 100644 --- a/services/mirror/mirror_pull.go +++ b/services/mirror/mirror_pull.go @@ -500,7 +500,7 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool { } if newCommit, err := gitRepo.GetCommit(newCommitID); err != nil { - log.Error("SyncMirrors [repo: %-v]: unable to get GetCommit [%s]: %v", m.Repo, newCommitID, err) + log.Error("SyncMirrors [repo: %-v]: unable to get commit %s: %v", m.Repo, newCommitID, err) continue } else { theCommits.HeadCommit = repo_module.CommitToPushCommit(newCommit)