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{}
|
Diff interface{}
|
||||||
LatestSha string
|
LatestSha string
|
||||||
}{
|
}{
|
||||||
Commits: result,
|
Commits: result,
|
||||||
Diff: ctx.Context.Data["Diff"],
|
Diff: ctx.Context.Data["Diff"],
|
||||||
LatestSha: headBranch,
|
}
|
||||||
|
|
||||||
|
if len(different.Commits) != 0 {
|
||||||
|
different.LatestSha = different.Commits[0].Sha
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.JSON(200, different)
|
ctx.JSON(200, different)
|
||||||
|
|
Loading…
Reference in New Issue