Skip to content

Commit a08175a

Browse files
shashvat-kedialafrikszeripath
committed
Repo name added to automatically generated commit message when mergin… (#9997)
* Repo name added to automatically generated commit message when merging pull request * As per @lunny Co-authored-by: Lauris BH <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent e8860ef commit a08175a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

models/pull.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ func (pr *PullRequest) GetDefaultMergeMessage() string {
185185
log.Error("Cannot load issue %d for PR id %d: Error: %v", pr.IssueID, pr.ID, err)
186186
return ""
187187
}
188-
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)
188+
189+
if pr.BaseRepoID == pr.HeadRepoID {
190+
return fmt.Sprintf("Merge pull request '%s' (#%d) from %s into %s", pr.Issue.Title, pr.Issue.Index, pr.HeadBranch, pr.BaseBranch)
191+
}
192+
193+
return fmt.Sprintf("Merge pull request '%s' (#%d) from %s:%s into %s", pr.Issue.Title, pr.Issue.Index, pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseBranch)
189194
}
190195

191196
// GetCommitMessages returns the commit messages between head and merge base (if there is one)

0 commit comments

Comments
 (0)