summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-26 06:58:07 +0100
committerGitHub <noreply@github.com>2020-05-26 01:58:07 -0400
commit5cb201dc93bf41556556f2154ea28755907fd550 (patch)
treeeefbd70bb80a2b2204a18b776f9d0198855e087b /routers
parentb97917a6e7b7a7852d1c0f39a96e06eeb7aab6de (diff)
downloadgitea-5cb201dc93bf41556556f2154ea28755907fd550.tar.gz
gitea-5cb201dc93bf41556556f2154ea28755907fd550.zip
Fix numbr of files, total additions, and deletions (#11614)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/commit.go2
-rw-r--r--routers/repo/compare.go2
-rw-r--r--routers/repo/editor.go2
-rw-r--r--routers/repo/pull.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index d87d220f24..2b6c9cece5 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -291,7 +291,7 @@ func Diff(ctx *context.Context) {
ctx.Data["Author"] = models.ValidateCommitWithEmail(commit)
ctx.Data["Diff"] = diff
ctx.Data["Parents"] = parents
- ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
+ ctx.Data["DiffNotAvailable"] = diff.NumFiles == 0
if err := models.CalculateTrustStatus(verification, ctx.Repo.Repository, nil); err != nil {
ctx.ServerError("CalculateTrustStatus", err)
diff --git a/routers/repo/compare.go b/routers/repo/compare.go
index 97bb5e6b18..858e4e548e 100644
--- a/routers/repo/compare.go
+++ b/routers/repo/compare.go
@@ -437,7 +437,7 @@ func PrepareCompareDiff(
return false
}
ctx.Data["Diff"] = diff
- ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
+ ctx.Data["DiffNotAvailable"] = diff.NumFiles == 0
headCommit, err := headGitRepo.GetCommit(headCommitID)
if err != nil {
diff --git a/routers/repo/editor.go b/routers/repo/editor.go
index 2fa7976e00..f91ce1b462 100644
--- a/routers/repo/editor.go
+++ b/routers/repo/editor.go
@@ -339,7 +339,7 @@ func DiffPreviewPost(ctx *context.Context, form auth.EditPreviewDiffForm) {
return
}
- if diff.NumFiles() == 0 {
+ if diff.NumFiles == 0 {
ctx.PlainText(200, []byte(ctx.Tr("repo.editor.no_changes_to_show")))
return
}
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index d23c93d0b6..d4c99e2769 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -611,7 +611,7 @@ func ViewPullFiles(ctx *context.Context) {
}
ctx.Data["Diff"] = diff
- ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
+ ctx.Data["DiffNotAvailable"] = diff.NumFiles == 0
baseCommit, err := ctx.Repo.GitRepo.GetCommit(startCommitID)
if err != nil {