Skip to content

Commit

Permalink
Load issue before accessing index in merge message (go-gitea#22822)
Browse files Browse the repository at this point in the history
Fixes go-gitea#22821

Signed-off-by: jolheiser <john.olheiser@gmail.com>
  • Loading branch information
jolheiser committed Feb 9, 2023
1 parent 638fbd0 commit a464662
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/pull/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(ctx); err != nil {
return "", "", err
}
closeIssueIndexes = append(closeIssueIndexes, fmt.Sprintf("%s %s%d", closeWord, issueReference, ref.Issue.Index))
}
}
Expand Down

0 comments on commit a464662

Please sign in to comment.