mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-22 04:38:17 +08:00
Fix pull request availability check
This commit is contained in:
@ -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, "/")
|
||||
|
Reference in New Issue
Block a user