diff options
author | Shashvat Kedia <shashvat51@gmail.com> | 2020-01-08 17:23:07 +0530 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2020-01-08 11:53:07 +0000 |
commit | 632fb5badcbe1636e7cf25ad6e4f176fabf47677 (patch) | |
tree | c90aad172aabcd2abd5b9008fb2a242219cb87e3 /models | |
parent | 74d6ec6807f2191d259310a487458be377d91563 (diff) | |
download | gitea-632fb5badcbe1636e7cf25ad6e4f176fabf47677.tar.gz gitea-632fb5badcbe1636e7cf25ad6e4f176fabf47677.zip |
Fix #9552: Merge commits generated by pull request capture pull request details (#9635)
Diffstat (limited to 'models')
-rw-r--r-- | models/pull.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/models/pull.go b/models/pull.go index f86892cbfc..876036c9e1 100644 --- a/models/pull.go +++ b/models/pull.go @@ -175,7 +175,11 @@ func (pr *PullRequest) GetDefaultMergeMessage() string { return "" } } - return fmt.Sprintf("Merge branch '%s' of %s/%s into %s", pr.HeadBranch, pr.MustHeadUserName(), pr.HeadRepo.Name, pr.BaseBranch) + if err := pr.LoadIssue(); err != nil { + log.Error("Cannot load issue %d for PR id %d: Error: %v", pr.IssueID, pr.ID, err) + return "" + } + return fmt.Sprintf("Merge pull request '%s' (#%d) from %s/%s into %s", pr.Issue.Title, pr.Issue.Index, pr.MustHeadUserName(), pr.HeadBranch, pr.BaseBranch) } // GetCommitMessages returns the commit messages between head and merge base (if there is one) |