diff options
author | David Svantesson <davidsvantesson@gmail.com> | 2020-01-18 05:40:43 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-18 12:40:43 +0800 |
commit | aac8250b473600549105e8fd499a8d18f5bb3dd0 (patch) | |
tree | 7cc16b5750c4a0eb326c25162ae750f61c8b5c56 /models/pull.go | |
parent | fec1095f1729fefa8c0feca8cad8e8e81591d348 (diff) | |
download | gitea-aac8250b473600549105e8fd499a8d18f5bb3dd0.tar.gz gitea-aac8250b473600549105e8fd499a8d18f5bb3dd0.zip |
Explicitly refer to PR in squash-merge commit message in case of external tracker (#9844)
* Explicitly refer to PR in squash-merge commit message in case of external tracker
* documentation
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/pull.go')
-rw-r--r-- | models/pull.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/models/pull.go b/models/pull.go index fcfcd221c4..3ef631852e 100644 --- a/models/pull.go +++ b/models/pull.go @@ -390,6 +390,13 @@ func (pr *PullRequest) GetDefaultSquashMessage() string { log.Error("LoadIssue: %v", err) return "" } + if err := pr.LoadBaseRepo(); err != nil { + log.Error("LoadBaseRepo: %v", err) + return "" + } + if pr.BaseRepo.UnitEnabled(UnitTypeExternalTracker) { + return fmt.Sprintf("%s (!%d)", pr.Issue.Title, pr.Issue.Index) + } return fmt.Sprintf("%s (#%d)", pr.Issue.Title, pr.Issue.Index) } |