更改:compare接口移除diff内容

This commit is contained in:
yystopf 2024-11-14 16:09:07 +08:00
parent 9a25439e7a
commit 0bfffa0ad8
1 changed files with 7 additions and 3 deletions

View File

@ -98,13 +98,15 @@ type CompareCommit struct {
}
func CompareDiff(ctx *context.APIContext) {
headUser, headRepo, headGitRepo, compareInfo, baseBranch, headBranch := ParseCompareInfo(ctx)
// headUser, headRepo, headGitRepo, compareInfo, baseBranch, headBranch := ParseCompareInfo(ctx)
_, _, headGitRepo, compareInfo, _, _ := ParseCompareInfo(ctx)
if ctx.Written() {
return
}
defer headGitRepo.Close()
_ = PrepareComapreDiff(ctx, headUser, headRepo, headGitRepo, compareInfo, baseBranch, headBranch)
// _ = PrepareComapreDiff(ctx, headUser, headRepo, headGitRepo, compareInfo, baseBranch, headBranch)
result := make([]CompareCommit, 0)
for _, commit := range compareInfo.Commits {
@ -123,13 +125,15 @@ func CompareDiff(ctx *context.APIContext) {
Diff interface{}
CommitsCount int
Latestsha string
FilesCount int
}{
Commits: result,
Diff: ctx.Data["Diff"],
// Diff: ctx.Data["Diff"],
}
different.CommitsCount = len(compareInfo.Commits)
different.Latestsha = compareInfo.HeadCommitID
different.FilesCount = compareInfo.NumFiles
ctx.JSON(http.StatusOK, different)
}