forked from Gitlink/gitea-1120-rc1
fix: fix error LatestSha field for compare API
This commit is contained in:
parent
f060033bdb
commit
ab3a701a42
|
@ -895,9 +895,12 @@ func CompareDiff(ctx *context.APIContext) {
|
|||
Diff interface{}
|
||||
LatestSha string
|
||||
}{
|
||||
Commits: result,
|
||||
Diff: ctx.Context.Data["Diff"],
|
||||
LatestSha: headBranch,
|
||||
Commits: result,
|
||||
Diff: ctx.Context.Data["Diff"],
|
||||
}
|
||||
|
||||
if len(different.Commits) != 0 {
|
||||
different.LatestSha = different.Commits[0].Sha
|
||||
}
|
||||
|
||||
ctx.JSON(200, different)
|
||||
|
|
Loading…
Reference in New Issue