From 9a2e43bff28ac92f180109fe900a6997614ea5a8 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 9 Dec 2015 20:46:05 -0500 Subject: move out git module and #1573 send push hook --- routers/repo/commit.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'routers/repo/commit.go') diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 101cb5c5..0f0e2203 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -10,9 +10,10 @@ import ( "github.com/Unknwon/paginater" + "github.com/gogits/git-shell" + "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/git" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/setting" ) @@ -55,7 +56,7 @@ func Commits(ctx *middleware.Context) { if page <= 1 { page = 1 } - ctx.Data["Page"] = paginater.New(commitsCount, git.CommitsRangeSize, page, 5) + ctx.Data["Page"] = paginater.New(int(commitsCount), git.CommitsRangeSize, page, 5) // Both `git log branchName` and `git log commitId` work. commits, err := ctx.Repo.Commit.CommitsByRange(page) @@ -123,7 +124,7 @@ func FileHistory(ctx *middleware.Context) { if page <= 1 { page = 1 } - ctx.Data["Page"] = paginater.New(commitsCount, git.CommitsRangeSize, page, 5) + ctx.Data["Page"] = paginater.New(int(commitsCount), git.CommitsRangeSize, page, 5) commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange(branchName, fileName, page) if err != nil { @@ -159,7 +160,7 @@ func Diff(ctx *middleware.Context) { parents := make([]string, commit.ParentCount()) for i := 0; i < commit.ParentCount(); i++ { - sha, err := commit.ParentId(i) + sha, err := commit.ParentID(i) parents[i] = sha.String() if err != nil { ctx.Handle(404, "repo.Diff", err) -- cgit v1.2.3