From 9a23fe131c567ff4f7e2b512a1bac4e3b98b1ba4 Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 24 Jun 2025 17:22:32 +0200 Subject: [PATCH] Ignore force pushes for changed files in a PR review (#34837) Fixes #34832 --------- Co-authored-by: wxiaoguang --- services/gitdiff/gitdiff.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index 895cbe5a2f..010040bc70 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -1356,6 +1356,7 @@ func SyncUserSpecificDiff(ctx context.Context, userID int64, pull *issues_model. // But as that does not work for all potential errors, we simply mark all files as unchanged and drop the error which always works, even if not as good as possible if err != nil { log.Error("Could not get changed files between %s and %s for pull request %d in repo with path %s. Assuming no changes. Error: %w", review.CommitSHA, latestCommit, pull.Index, gitRepo.Path, err) + err = nil //nolint } filesChangedSinceLastDiff := make(map[string]pull_model.ViewedState) @@ -1397,7 +1398,7 @@ outer: } } - return review, err + return review, nil } // CommentAsDiff returns c.Patch as *Diff