diff options
author | John Olheiser <john.olheiser@gmail.com> | 2023-02-08 20:47:52 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-09 10:47:52 +0800 |
commit | 4dd7d61ac8c8bff81a0f9e376032f45eb12f51a9 (patch) | |
tree | 58d568501d4365a1e0eb30e8f08a7ba004c7b3ec /services | |
parent | 5ae07d4c2f7bd0f58a15292fb93f2e0af45ab351 (diff) | |
download | gitea-4dd7d61ac8c8bff81a0f9e376032f45eb12f51a9.tar.gz gitea-4dd7d61ac8c8bff81a0f9e376032f45eb12f51a9.zip |
Load issue before accessing index in merge message (#22822)
Fixes #22821
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/pull/merge.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go index edd5b601da..a3d69df8df 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -98,6 +98,9 @@ func GetDefaultMergeMessage(ctx context.Context, baseGitRepo *git.Repository, pr } for _, ref := range refs { if ref.RefAction == references.XRefActionCloses { + if err := ref.LoadIssue(ctx); err != nil { + return "", "", err + } closeIssueIndexes = append(closeIssueIndexes, fmt.Sprintf("%s %s%d", closeWord, issueReference, ref.Issue.Index)) } } |