@@ -448,7 +448,7 @@ func runWeb(ctx *cli.Context) error {
448448 m .Combo ("" ).Get (repo .ProtectedBranch ).Post (repo .ProtectedBranchPost )
449449 m .Post ("/can_push" , repo .ChangeProtectedBranch )
450450 m .Post ("/delete" , repo .DeleteProtectedBranch )
451- })
451+ }, repo . MustBeNotBare )
452452
453453 m .Group ("/hooks" , func () {
454454 m .Get ("" , repo .Webhooks )
@@ -520,11 +520,11 @@ func runWeb(ctx *cli.Context) error {
520520 m .Get ("/new" , repo .NewRelease )
521521 m .Post ("/new" , bindIgnErr (auth.NewReleaseForm {}), repo .NewReleasePost )
522522 m .Post ("/delete" , repo .DeleteRelease )
523- }, reqRepoWriter , context .RepoRef ())
523+ }, repo . MustBeNotBare , reqRepoWriter , context .RepoRef ())
524524 m .Group ("/releases" , func () {
525525 m .Get ("/edit/*" , repo .EditRelease )
526526 m .Post ("/edit/*" , bindIgnErr (auth.EditReleaseForm {}), repo .EditReleasePost )
527- }, reqRepoWriter , func (ctx * context.Context ) {
527+ }, repo . MustBeNotBare , reqRepoWriter , func (ctx * context.Context ) {
528528 var err error
529529 ctx .Repo .Commit , err = ctx .Repo .GitRepo .GetBranchCommit (ctx .Repo .Repository .DefaultBranch )
530530 if err != nil {
@@ -563,25 +563,25 @@ func runWeb(ctx *cli.Context) error {
563563 return
564564 }
565565 })
566- }, reqRepoWriter , context .RepoRef (), func (ctx * context.Context ) {
566+ }, repo . MustBeNotBare , reqRepoWriter , context .RepoRef (), func (ctx * context.Context ) {
567567 if ! ctx .Repo .Repository .CanEnableEditor () || ctx .Repo .IsViewCommit {
568568 ctx .Handle (404 , "" , nil )
569569 return
570570 }
571571 })
572- }, reqSignIn , context .RepoAssignment (), repo . MustBeNotBare , context .UnitTypes ())
572+ }, reqSignIn , context .RepoAssignment (), context .UnitTypes ())
573573
574574 m .Group ("/:username/:reponame" , func () {
575575 m .Group ("" , func () {
576- m .Get ("/releases" , repo .Releases )
576+ m .Get ("/releases" , repo .MustBeNotBare , repo . Releases )
577577 m .Get ("/^:type(issues|pulls)$" , repo .RetrieveLabels , repo .Issues )
578578 m .Get ("/^:type(issues|pulls)$/:index" , repo .ViewIssue )
579579 m .Get ("/labels/" , repo .RetrieveLabels , repo .Labels )
580580 m .Get ("/milestones" , repo .Milestones )
581581 }, context .RepoRef ())
582582
583583 // m.Get("/branches", repo.Branches)
584- m .Post ("/branches/:name/delete" , reqSignIn , reqRepoWriter , repo .DeleteBranchPost )
584+ m .Post ("/branches/:name/delete" , reqSignIn , reqRepoWriter , repo .MustBeNotBare , repo . DeleteBranchPost )
585585
586586 m .Group ("/wiki" , func () {
587587 m .Get ("/?:page" , repo .Wiki )
@@ -601,7 +601,7 @@ func runWeb(ctx *cli.Context) error {
601601 m .Get ("/*" , repo .WikiRaw )
602602 }, repo .MustEnableWiki )
603603
604- m .Get ("/archive/*" , repo .Download )
604+ m .Get ("/archive/*" , repo .MustBeNotBare , repo . Download )
605605
606606 m .Group ("/pulls/:index" , func () {
607607 m .Get ("/commits" , context .RepoRef (), repo .ViewPullCommits )
@@ -617,10 +617,10 @@ func runWeb(ctx *cli.Context) error {
617617 m .Get ("/commit/:sha([a-f0-9]{7,40})$" , repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .Diff )
618618 m .Get ("/forks" , repo .Forks )
619619 }, context .RepoRef ())
620- m .Get ("/commit/:sha([a-f0-9]{7,40})\\ .:ext(patch|diff)" , repo .RawDiff )
620+ m .Get ("/commit/:sha([a-f0-9]{7,40})\\ .:ext(patch|diff)" , repo .MustBeNotBare , repo . RawDiff )
621621
622- m .Get ("/compare/:before([a-z0-9]{40})\\ .\\ .\\ .:after([a-z0-9]{40})" , repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .CompareDiff )
623- }, ignSignIn , context .RepoAssignment (), repo . MustBeNotBare , context .UnitTypes ())
622+ m .Get ("/compare/:before([a-z0-9]{40})\\ .\\ .\\ .:after([a-z0-9]{40})" , repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .MustBeNotBare , repo . CompareDiff )
623+ }, ignSignIn , context .RepoAssignment (), context .UnitTypes ())
624624 m .Group ("/:username/:reponame" , func () {
625625 m .Get ("/stars" , repo .Stars )
626626 m .Get ("/watchers" , repo .Watchers )
@@ -630,7 +630,7 @@ func runWeb(ctx *cli.Context) error {
630630 m .Group ("/:reponame" , func () {
631631 m .Get ("" , repo .SetEditorconfigIfExists , repo .Home )
632632 m .Get ("\\ .git$" , repo .SetEditorconfigIfExists , repo .Home )
633- }, ignSignIn , context .RepoAssignment (true ), context .RepoRef (), context .UnitTypes ())
633+ }, ignSignIn , context .RepoAssignment (), context .RepoRef (), context .UnitTypes ())
634634
635635 m .Group ("/:reponame" , func () {
636636 m .Group ("/info/lfs" , func () {
0 commit comments