forked from forgejo/forgejo
Fix pull request availability check
This commit is contained in:
parent
0ea0c5ec4f
commit
0e9bc2d410
13 changed files with 69 additions and 43 deletions
|
@ -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, "/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue