Skip to content

Commit 5a7ab86

Browse files
authored
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: ![image](https://github.com/go-gitea/gitea/assets/18380374/d30927dd-9227-4653-8fac-b890ef0b3f88) This makes no sense, so we should check whether the title is surely changed before run the `ChangeTitle`.
1 parent 7b79be2 commit 5a7ab86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

services/issue/issue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_mode
5353
oldTitle := issue.Title
5454
issue.Title = title
5555

56+
if oldTitle == title {
57+
return nil
58+
}
59+
5660
if err := issues_model.ChangeIssueTitle(ctx, issue, doer, oldTitle); err != nil {
5761
return err
5862
}

0 commit comments

Comments
 (0)