diff --git a/routers/repo/pull.go b/routers/repo/pull.go index c29cfb81b22d0..423c1e188201d 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -1162,6 +1162,23 @@ func DownloadPullDiffOrPatch(ctx *context.Context, patch bool) { pr := issue.PullRequest + if pr.HasMerged { + diffType := git.RawDiffNormal + if patch { + diffType = git.RawDiffPatch + } + if err := git.GetRawDiff( + models.RepoPath(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name), + pr.MergedCommitID, + diffType, + ctx, + ); err != nil { + ctx.ServerError("GetRawDiff", err) + return + } + return + } + if err := pull_service.DownloadDiffOrPatch(pr, ctx, patch); err != nil { ctx.ServerError("DownloadDiffOrPatch", err) return