aboutsummaryrefslogtreecommitdiff
path: root/modules/middleware/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r--modules/middleware/context.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index cee5d100..d2b7de4a 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -27,6 +27,13 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+type PullRequestContext struct {
+ BaseRepo *models.Repository
+ Allowed bool
+ SameRepo bool
+ HeadInfo string // [<user>:]<branch>
+}
+
type RepoContext struct {
AccessMode models.AccessMode
IsWatching bool
@@ -46,6 +53,8 @@ type RepoContext struct {
CloneLink models.CloneLink
CommitsCount int64
Mirror *models.Mirror
+
+ PullRequest *PullRequestContext
}
// Context represents context of a request.
@@ -211,7 +220,9 @@ func Contexter() macaron.Handler {
csrf: x,
Flash: f,
Session: sess,
- Repo: &RepoContext{},
+ Repo: &RepoContext{
+ PullRequest: &PullRequestContext{},
+ },
}
// Compute current URL for real-time change language.
ctx.Data["Link"] = setting.AppSubUrl + strings.TrimSuffix(ctx.Req.URL.Path, "/")