mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Avoid run change title process when the title is same (#27467)
If user only changed the target branch or just did nothing and clicked the `Save` button, you will see the change log as following:  This makes no sense, so we should check whether the title is surely changed before run the `ChangeTitle`.
This commit is contained in:
		@@ -53,6 +53,10 @@ func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_mode
 | 
				
			|||||||
	oldTitle := issue.Title
 | 
						oldTitle := issue.Title
 | 
				
			||||||
	issue.Title = title
 | 
						issue.Title = title
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if oldTitle == title {
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := issues_model.ChangeIssueTitle(ctx, issue, doer, oldTitle); err != nil {
 | 
						if err := issues_model.ChangeIssueTitle(ctx, issue, doer, oldTitle); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user