mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 11:43:10 +02:00
fix: Invalid UTF-8 commit messages in JSON API responses (#37542)
This commit is contained in:
1 parent
2200ed7499
commit
c9b9e376fb
54 files changed
+221
-215
No files matched your search
+7
-11
@@ -150,17 +150,13 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get commit %s in repository: %s Error: %w", opts.NewCommitIDs[i], repo.FullName(), err)
|
||||
}
|
||||
}
|
||||
|
||||
// create a new pull request
|
||||
if title == "" {
|
||||
title = strings.Split(commit.CommitMessage, "\n")[0]
|
||||
}
|
||||
if description == "" {
|
||||
_, description, _ = strings.Cut(commit.CommitMessage, "\n\n")
|
||||
}
|
||||
if description == "" {
|
||||
description = title
|
||||
// create a new pull request
|
||||
if title == "" {
|
||||
title = commit.MessageTitle()
|
||||
}
|
||||
if description == "" {
|
||||
description = commit.MessageBody()
|
||||
}
|
||||
}
|
||||
|
||||
prIssue := &issues_model.Issue{
|
||||
|
||||
Reference in new issue
Block a user