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>
This commit is contained in:
David Svantesson 2020-01-18 05:40:43 +01:00 committed by Lunny Xiao
parent fec1095f17
commit aac8250b47
2 changed files with 9 additions and 1 deletions

View file

@ -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)
}