mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
[gitea] week 2025-16 cherry pick (gitea/main -> forgejo) (#7602)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7602 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
commit
3ebd96ef73
10 changed files with 141 additions and 25 deletions
|
@ -401,6 +401,7 @@ func setMergeTarget(ctx *context.Context, pull *issues_model.PullRequest) {
|
|||
|
||||
// GetPullDiffStats get Pull Requests diff stats
|
||||
func GetPullDiffStats(ctx *context.Context) {
|
||||
// FIXME: this getPullInfo seems to be a duplicate call with other route handlers
|
||||
issue, ok := getPullInfo(ctx)
|
||||
if !ok {
|
||||
return
|
||||
|
@ -408,15 +409,15 @@ func GetPullDiffStats(ctx *context.Context) {
|
|||
pull := issue.PullRequest
|
||||
|
||||
mergeBaseCommitID := GetMergedBaseCommitID(ctx, issue)
|
||||
|
||||
if mergeBaseCommitID == "" {
|
||||
ctx.NotFound("PullFiles", nil)
|
||||
return
|
||||
}
|
||||
|
||||
// do not report 500 server error to end users if error occurs, otherwise a PR missing ref won't be able to view.
|
||||
headCommitID, err := ctx.Repo.GitRepo.GetRefCommitID(pull.GetGitRefName())
|
||||
if err != nil {
|
||||
ctx.ServerError("GetRefCommitID", err)
|
||||
log.Error("Failed to GetRefCommitID: %v, repo: %v", err, ctx.Repo.Repository.FullName())
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue