diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-30 10:19:36 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-30 10:19:36 +0800 |
commit | cd800d7837caefb129e0f006c8973460a2d64d4a (patch) | |
tree | 6c5f06fd3a1802c07332f247e2a1b3d2bc0b5c1b /modules/middleware/context.go | |
parent | 50391f434e9f7f216ce0f907b532cbe4ca2bbeb2 (diff) | |
parent | b27c34f39acee3bf7b6594a1f0db2183b343326c (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r-- | modules/middleware/context.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go index d81ab999..a6aa58ee 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -18,6 +18,7 @@ import ( "github.com/codegangsta/martini" "github.com/gogits/cache" + "github.com/gogits/git" "github.com/gogits/session" "github.com/gogits/gogs/models" @@ -41,11 +42,18 @@ type Context struct { csrfToken string Repo struct { - IsValid bool IsOwner bool IsWatching bool + IsBranch bool + IsTag bool + IsCommit bool Repository *models.Repository Owner *models.User + Commit *git.Commit + GitRepo *git.Repository + BranchName string + CommitId string + RepoLink string CloneLink struct { SSH string HTTPS string @@ -98,6 +106,10 @@ func (ctx *Context) Handle(status int, title string, err error) { ctx.HTML(status, fmt.Sprintf("status/%d", status)) } +func (ctx *Context) Debug(msg string, args ...interface{}) { + log.Debug(msg, args...) +} + func (ctx *Context) GetCookie(name string) string { cookie, err := ctx.Req.Cookie(name) if err != nil { |