aboutsummaryrefslogtreecommitdiffstats
path: root/modules/middleware
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-09 20:46:05 -0500
committerUnknwon <u@gogs.io>2015-12-09 20:46:05 -0500
commit9a2e43bff28ac92f180109fe900a6997614ea5a8 (patch)
tree564dbb6fb30c153e43b0e18499d80e7d93dd0bee /modules/middleware
parentbd5dc626e82e18d3e619d918e579dc130edcd1fa (diff)
downloadgitea-9a2e43bff28ac92f180109fe900a6997614ea5a8.tar.gz
gitea-9a2e43bff28ac92f180109fe900a6997614ea5a8.zip
move out git module and #1573 send push hook
Diffstat (limited to 'modules/middleware')
-rw-r--r--modules/middleware/context.go5
-rw-r--r--modules/middleware/repo.go15
2 files changed, 11 insertions, 9 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 5784d756b2..46a5c1f65d 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -18,10 +18,11 @@ import (
"github.com/go-macaron/session"
"gopkg.in/macaron.v1"
+ "github.com/gogits/git-shell"
+
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/base"
- "github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)
@@ -43,7 +44,7 @@ type RepoContext struct {
CommitID string
RepoLink string
CloneLink models.CloneLink
- CommitsCount int
+ CommitsCount int64
Mirror *models.Mirror
}
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 5a9ee0c0d1..a6dd39664f 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -11,8 +11,9 @@ import (
"gopkg.in/macaron.v1"
+ "github.com/gogits/git-shell"
+
"github.com/gogits/gogs/models"
- "github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
)
@@ -257,9 +258,9 @@ func RepoRef() macaron.Handler {
}
refName = brs[0]
}
- ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommitOfBranch(refName)
+ ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
if err != nil {
- ctx.Handle(500, "GetCommitOfBranch", err)
+ ctx.Handle(500, "GetBranchCommit", err)
return
}
ctx.Repo.CommitID = ctx.Repo.Commit.ID.String()
@@ -288,18 +289,18 @@ func RepoRef() macaron.Handler {
if ctx.Repo.GitRepo.IsBranchExist(refName) {
ctx.Repo.IsViewBranch = true
- ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommitOfBranch(refName)
+ ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
if err != nil {
- ctx.Handle(500, "GetCommitOfBranch", err)
+ ctx.Handle(500, "GetBranchCommit", err)
return
}
ctx.Repo.CommitID = ctx.Repo.Commit.ID.String()
} else if ctx.Repo.GitRepo.IsTagExist(refName) {
ctx.Repo.IsViewTag = true
- ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommitOfTag(refName)
+ ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(refName)
if err != nil {
- ctx.Handle(500, "GetCommitOfTag", err)
+ ctx.Handle(500, "GetTagCommit", err)
return
}
ctx.Repo.CommitID = ctx.Repo.Commit.ID.String()