mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-15 21:31:29 +02:00
revert unnecessary change
This commit is contained in:
parent
84bbcf9844
commit
f717d4f2e5
@ -533,26 +533,24 @@ func PrepareCompareDiff(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
commits, err := processGitCommits(ctx, ci.Commits)
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("processGitCommits", err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
ctx.Data["Commits"] = commits
|
||||||
|
ctx.Data["CommitCount"] = len(commits)
|
||||||
|
|
||||||
title := ci.HeadRef.ShortName()
|
title := ci.HeadRef.ShortName()
|
||||||
|
if len(commits) == 1 {
|
||||||
|
c := commits[0]
|
||||||
|
title = strings.TrimSpace(c.UserCommit.Summary())
|
||||||
|
|
||||||
if len(ci.Commits) > 0 {
|
body := strings.Split(strings.TrimSpace(c.UserCommit.Message()), "\n")
|
||||||
commits, err := processGitCommits(ctx, ci.Commits)
|
if len(body) > 1 {
|
||||||
if err != nil {
|
ctx.Data["content"] = strings.Join(body[1:], "\n")
|
||||||
ctx.ServerError("processGitCommits", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
ctx.Data["Commits"] = commits
|
|
||||||
if len(commits) == 1 {
|
|
||||||
c := commits[0]
|
|
||||||
title = strings.TrimSpace(c.UserCommit.Summary())
|
|
||||||
|
|
||||||
body := strings.Split(strings.TrimSpace(c.UserCommit.Message()), "\n")
|
|
||||||
if len(body) > 1 {
|
|
||||||
ctx.Data["content"] = strings.Join(body[1:], "\n")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.Data["CommitCount"] = len(ci.Commits)
|
|
||||||
|
|
||||||
if len(title) > 255 {
|
if len(title) > 255 {
|
||||||
var trailer string
|
var trailer string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user