mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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 <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -185,7 +185,12 @@ func (pr *PullRequest) GetDefaultMergeMessage() string {
 | 
			
		||||
		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)
 | 
			
		||||
 | 
			
		||||
	if pr.BaseRepoID == pr.HeadRepoID {
 | 
			
		||||
		return fmt.Sprintf("Merge pull request '%s' (#%d) from %s into %s", pr.Issue.Title, pr.Issue.Index, pr.HeadBranch, pr.BaseBranch)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetCommitMessages returns the commit messages between head and merge base (if there is one)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user