diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 53fbf0af76..d7e73a0cfb 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1322,6 +1322,7 @@ commit_graph.color = Color commit.contained_in = This commit is contained in: commit.contained_in_default_branch = This commit is part of the default branch commit.load_referencing_branches_and_tags = Load branches and tags referencing this commit +commit.merged_in_pr = This commit was merged in pull request %s. blame = Blame download_file = Download file normal_view = Normal View diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 9a06c9359b..0c60abcecd 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -15,6 +15,7 @@ import ( asymkey_model "code.gitea.io/gitea/models/asymkey" "code.gitea.io/gitea/models/db" git_model "code.gitea.io/gitea/models/git" + issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/models/renderhelper" repo_model "code.gitea.io/gitea/models/repo" unit_model "code.gitea.io/gitea/models/unit" @@ -411,6 +412,11 @@ func Diff(ctx *context.Context) { } } + pr, _ := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, commitID) + if pr != nil { + ctx.Data["MergedPRIssueNumber"] = pr.Index + } + ctx.HTML(http.StatusOK, tplCommitPage) } diff --git a/templates/repo/commit_load_branches_and_tags.tmpl b/templates/repo/commit_load_branches_and_tags.tmpl index ffa0e530e8..ecb210c575 100644 --- a/templates/repo/commit_load_branches_and_tags.tmpl +++ b/templates/repo/commit_load_branches_and_tags.tmpl @@ -1,5 +1,12 @@ {{if not .PageIsWiki}}