diff --git a/routers/hat/repo/repo.go b/routers/hat/repo/repo.go index fe41163..0ad12cf 100644 --- a/routers/hat/repo/repo.go +++ b/routers/hat/repo/repo.go @@ -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) }