Merge branch 'master' into feature/goimports
This commit is contained in:
commit
f36544f98d
5 changed files with 8 additions and 27 deletions
13
cmd/web.go
13
cmd/web.go
|
@ -518,7 +518,8 @@ func runWeb(ctx *cli.Context) error {
|
||||||
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
|
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
|
||||||
})
|
})
|
||||||
|
|
||||||
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest).
|
m.Combo("/compare/*", repo.MustAllowPulls, repo.SetEditorconfigIfExists).
|
||||||
|
Get(repo.CompareAndPullRequest).
|
||||||
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
|
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
|
||||||
|
|
||||||
m.Group("", func() {
|
m.Group("", func() {
|
||||||
|
@ -577,15 +578,15 @@ func runWeb(ctx *cli.Context) error {
|
||||||
|
|
||||||
m.Group("/pulls/:index", func() {
|
m.Group("/pulls/:index", func() {
|
||||||
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
|
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
|
||||||
m.Get("/files", context.RepoRef(), repo.ViewPullFiles)
|
m.Get("/files", context.RepoRef(), repo.SetEditorconfigIfExists, repo.ViewPullFiles)
|
||||||
m.Post("/merge", reqRepoWriter, repo.MergePullRequest)
|
m.Post("/merge", reqRepoWriter, repo.MergePullRequest)
|
||||||
}, repo.MustAllowPulls)
|
}, repo.MustAllowPulls)
|
||||||
|
|
||||||
m.Group("", func() {
|
m.Group("", func() {
|
||||||
m.Get("/src/*", repo.Home)
|
m.Get("/src/*", repo.SetEditorconfigIfExists, repo.Home)
|
||||||
m.Get("/raw/*", repo.SingleDownload)
|
m.Get("/raw/*", repo.SingleDownload)
|
||||||
m.Get("/commits/*", repo.RefCommits)
|
m.Get("/commits/*", repo.RefCommits)
|
||||||
m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.Diff)
|
m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.SetEditorconfigIfExists, repo.Diff)
|
||||||
m.Get("/forks", repo.Forks)
|
m.Get("/forks", repo.Forks)
|
||||||
}, context.RepoRef())
|
}, context.RepoRef())
|
||||||
m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)
|
m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)
|
||||||
|
@ -599,8 +600,8 @@ func runWeb(ctx *cli.Context) error {
|
||||||
|
|
||||||
m.Group("/:username", func() {
|
m.Group("/:username", func() {
|
||||||
m.Group("/:reponame", func() {
|
m.Group("/:reponame", func() {
|
||||||
m.Get("", repo.Home)
|
m.Get("", repo.SetEditorconfigIfExists, repo.Home)
|
||||||
m.Get("\\.git$", repo.Home)
|
m.Get("\\.git$", repo.SetEditorconfigIfExists, repo.Home)
|
||||||
}, ignSignIn, context.RepoAssignment(true), context.RepoRef())
|
}, ignSignIn, context.RepoAssignment(true), context.RepoRef())
|
||||||
|
|
||||||
m.Group("/:reponame", func() {
|
m.Group("/:reponame", func() {
|
||||||
|
|
|
@ -177,11 +177,6 @@ func Diff(ctx *context.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setEditorconfigIfExists(ctx)
|
|
||||||
if ctx.Written() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.Data["CommitID"] = commitID
|
ctx.Data["CommitID"] = commitID
|
||||||
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
||||||
ctx.Data["Username"] = userName
|
ctx.Data["Username"] = userName
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
git "github.com/gogits/git-module"
|
git "github.com/gogits/git-module"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setEditorconfigIfExists(ctx *context.Context) {
|
func SetEditorconfigIfExists(ctx *context.Context) {
|
||||||
ec, err := ctx.Repo.GetEditorconfig()
|
ec, err := ctx.Repo.GetEditorconfig()
|
||||||
|
|
||||||
if err != nil && !git.IsErrNotExist(err) {
|
if err != nil && !git.IsErrNotExist(err) {
|
||||||
|
|
|
@ -366,11 +366,6 @@ func ViewPullFiles(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
setEditorconfigIfExists(ctx)
|
|
||||||
if ctx.Written() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name)
|
headTarget := path.Join(pull.HeadUserName, pull.HeadRepo.Name)
|
||||||
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
||||||
ctx.Data["Username"] = pull.HeadUserName
|
ctx.Data["Username"] = pull.HeadUserName
|
||||||
|
@ -623,11 +618,6 @@ func CompareAndPullRequest(ctx *context.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setEditorconfigIfExists(ctx)
|
|
||||||
if ctx.Written() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.HTML(200, COMPARE_PULL)
|
ctx.HTML(200, COMPARE_PULL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,11 +243,6 @@ func Home(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
setEditorconfigIfExists(ctx)
|
|
||||||
if ctx.Written() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var treeNames []string
|
var treeNames []string
|
||||||
paths := make([]string, 0, 5)
|
paths := make([]string, 0, 5)
|
||||||
if len(ctx.Repo.TreePath) > 0 {
|
if len(ctx.Repo.TreePath) > 0 {
|
||||||
|
|
Loading…
Reference in a new issue