mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
remove Context.IsValid & verify repo in middleware repo.go
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user