summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2023-02-09 15:53:14 -0600
committerGitHub <noreply@github.com>2023-02-09 16:53:14 -0500
commit68b908d92a5e6615b8a423d406951c5fc2d528ae (patch)
treef8ec98b0ba72591a8719b09191d1da1b93f799ce
parent638fbd0b78f3464b5cebcad26d3f18cb32183069 (diff)
downloadgitea-68b908d92a5e6615b8a423d406951c5fc2d528ae.tar.gz
gitea-68b908d92a5e6615b8a423d406951c5fc2d528ae.zip
Load issue before accessing index in merge message (#22822) (#22830)
Backport #22822 --------- Signed-off-by: jolheiser <john.olheiser@gmail.com>
-rw-r--r--services/pull/merge.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index ddfac5a219..2ae23b3447 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -99,6 +99,9 @@ func GetDefaultMergeMessage(baseGitRepo *git.Repository, pr *issues_model.PullRe
}
for _, ref := range refs {
if ref.RefAction == references.XRefActionCloses {
+ if err := ref.LoadIssue(); err != nil {
+ return "", err
+ }
closeIssueIndexes = append(closeIssueIndexes, fmt.Sprintf("%s %s%d", closeWord, issueReference, ref.Issue.Index))
}
}