Skip to content

Commit

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

Signed-off-by: jolheiser <[email protected]>
  • Loading branch information
jolheiser committed Feb 9, 2023
1 parent 5ae07d4 commit 4dd7d61
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 @@ -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))
}
}
Expand Down

0 comments on commit 4dd7d61

Please sign in to comment.