@@ -1153,7 +1153,7 @@ func registerRoutes(m *web.Router) {
11531153 // end "/{username}/{reponame}/settings"
11541154
11551155 // user/org home, including rss feeds
1156- m .Get ("/{username}/{reponame}" , optSignIn , context .RepoAssignment , context .RepoRef ( ), repo .SetEditorconfigIfExists , repo .Home )
1156+ m .Get ("/{username}/{reponame}" , optSignIn , context .RepoAssignment , context .RepoRefByType ( git . RefTypeBranch ), repo .SetEditorconfigIfExists , repo .Home )
11571157
11581158 m .Post ("/{username}/{reponame}/markup" , optSignIn , context .RepoAssignment , reqUnitsWithMarkdown , web .Bind (structs.MarkupOption {}), misc .Markup )
11591159
@@ -1333,39 +1333,36 @@ func registerRoutes(m *web.Router) {
13331333 m .Group ("/{username}/{reponame}" , func () { // repo tags
13341334 m .Group ("/tags" , func () {
13351335 m .Get ("" , repo .TagsList )
1336- m .Get ("/list" , repo .GetTagList )
13371336 m .Get (".rss" , feedEnabled , repo .TagsListFeedRSS )
13381337 m .Get (".atom" , feedEnabled , repo .TagsListFeedAtom )
1339- }, ctxDataSet ("EnableFeed" , setting .Other .EnableFeed ),
1340- repo .MustBeNotEmpty , context .RepoRefByType (git .RefTypeTag , context.RepoRefByTypeOptions {IgnoreNotExistErr : true }))
1341- m .Post ("/tags/delete" , repo .DeleteTag , reqSignIn ,
1342- repo .MustBeNotEmpty , context .RepoMustNotBeArchived (), reqRepoCodeWriter , context .RepoRef ())
1343- }, optSignIn , context .RepoAssignment , reqUnitCodeReader )
1338+ m .Get ("/list" , repo .GetTagList )
1339+ }, ctxDataSet ("EnableFeed" , setting .Other .EnableFeed ))
1340+ m .Post ("/tags/delete" , reqSignIn , reqRepoCodeWriter , context .RepoMustNotBeArchived (), repo .DeleteTag )
1341+ }, optSignIn , context .RepoAssignment , repo .MustBeNotEmpty , reqUnitCodeReader )
13441342 // end "/{username}/{reponame}": repo tags
13451343
13461344 m .Group ("/{username}/{reponame}" , func () { // repo releases
13471345 m .Group ("/releases" , func () {
13481346 m .Get ("" , repo .Releases )
1349- m .Get ("/tag/*" , repo .SingleRelease )
1350- m .Get ("/latest" , repo .LatestRelease )
13511347 m .Get (".rss" , feedEnabled , repo .ReleasesFeedRSS )
13521348 m .Get (".atom" , feedEnabled , repo .ReleasesFeedAtom )
1353- }, ctxDataSet ("EnableFeed" , setting .Other .EnableFeed ),
1354- repo .MustBeNotEmpty , context .RepoRefByType (git .RefTypeTag , context.RepoRefByTypeOptions {IgnoreNotExistErr : true }))
1355- m .Get ("/releases/attachments/{uuid}" , repo .MustBeNotEmpty , repo .GetAttachment )
1356- m .Get ("/releases/download/{vTag}/{fileName}" , repo .MustBeNotEmpty , repo .RedirectDownload )
1349+ m .Get ("/tag/*" , context .RepoRefByType (git .RefTypeTag ), repo .SingleRelease )
1350+ m .Get ("/latest" , repo .LatestRelease )
1351+ }, ctxDataSet ("EnableFeed" , setting .Other .EnableFeed ))
1352+ m .Get ("/releases/attachments/{uuid}" , repo .GetAttachment )
1353+ m .Get ("/releases/download/{vTag}/{fileName}" , repo .RedirectDownload )
13571354 m .Group ("/releases" , func () {
13581355 m .Get ("/new" , repo .NewRelease )
13591356 m .Post ("/new" , web .Bind (forms.NewReleaseForm {}), repo .NewReleasePost )
13601357 m .Post ("/delete" , repo .DeleteRelease )
13611358 m .Post ("/attachments" , repo .UploadReleaseAttachment )
13621359 m .Post ("/attachments/remove" , repo .DeleteAttachment )
1363- }, reqSignIn , repo . MustBeNotEmpty , context .RepoMustNotBeArchived (), reqRepoReleaseWriter , context .RepoRef ())
1360+ }, reqSignIn , context .RepoMustNotBeArchived (), reqRepoReleaseWriter , context .RepoRef ())
13641361 m .Group ("/releases" , func () {
13651362 m .Get ("/edit/*" , repo .EditRelease )
13661363 m .Post ("/edit/*" , web .Bind (forms.EditReleaseForm {}), repo .EditReleasePost )
1367- }, reqSignIn , repo . MustBeNotEmpty , context .RepoMustNotBeArchived (), reqRepoReleaseWriter , repo .CommitInfoCache )
1368- }, optSignIn , context .RepoAssignment , reqRepoReleaseReader )
1364+ }, reqSignIn , context .RepoMustNotBeArchived (), reqRepoReleaseWriter , repo .CommitInfoCache )
1365+ }, optSignIn , context .RepoAssignment , repo . MustBeNotEmpty , reqRepoReleaseReader )
13691366 // end "/{username}/{reponame}": repo releases
13701367
13711368 m .Group ("/{username}/{reponame}" , func () { // to maintain compatibility with old attachments
@@ -1529,21 +1526,19 @@ func registerRoutes(m *web.Router) {
15291526 }, repo .MustBeNotEmpty , context .RepoRef ())
15301527
15311528 m .Group ("/media" , func () {
1529+ m .Get ("/blob/{sha}" , repo .DownloadByIDOrLFS )
15321530 m .Get ("/branch/*" , context .RepoRefByType (git .RefTypeBranch ), repo .SingleDownloadOrLFS )
15331531 m .Get ("/tag/*" , context .RepoRefByType (git .RefTypeTag ), repo .SingleDownloadOrLFS )
15341532 m .Get ("/commit/*" , context .RepoRefByType (git .RefTypeCommit ), repo .SingleDownloadOrLFS )
1535- m .Get ("/blob/{sha}" , repo .DownloadByIDOrLFS )
1536- // "/*" route is deprecated, and kept for backward compatibility
1537- m .Get ("/*" , context .RepoRefByType ("" ), repo .SingleDownloadOrLFS )
1533+ m .Get ("/*" , context .RepoRefByType ("" ), repo .SingleDownloadOrLFS ) // "/*" route is deprecated, and kept for backward compatibility
15381534 }, repo .MustBeNotEmpty )
15391535
15401536 m .Group ("/raw" , func () {
1537+ m .Get ("/blob/{sha}" , repo .DownloadByID )
15411538 m .Get ("/branch/*" , context .RepoRefByType (git .RefTypeBranch ), repo .SingleDownload )
15421539 m .Get ("/tag/*" , context .RepoRefByType (git .RefTypeTag ), repo .SingleDownload )
15431540 m .Get ("/commit/*" , context .RepoRefByType (git .RefTypeCommit ), repo .SingleDownload )
1544- m .Get ("/blob/{sha}" , repo .DownloadByID )
1545- // "/*" route is deprecated, and kept for backward compatibility
1546- m .Get ("/*" , context .RepoRefByType ("" ), repo .SingleDownload )
1541+ m .Get ("/*" , context .RepoRefByType ("" ), repo .SingleDownload ) // "/*" route is deprecated, and kept for backward compatibility
15471542 }, repo .MustBeNotEmpty )
15481543
15491544 m .Group ("/render" , func () {
@@ -1557,8 +1552,7 @@ func registerRoutes(m *web.Router) {
15571552 m .Get ("/branch/*" , context .RepoRefByType (git .RefTypeBranch ), repo .RefCommits )
15581553 m .Get ("/tag/*" , context .RepoRefByType (git .RefTypeTag ), repo .RefCommits )
15591554 m .Get ("/commit/*" , context .RepoRefByType (git .RefTypeCommit ), repo .RefCommits )
1560- // "/*" route is deprecated, and kept for backward compatibility
1561- m .Get ("/*" , context .RepoRefByType ("" ), repo .RefCommits )
1555+ m .Get ("/*" , context .RepoRefByType ("" ), repo .RefCommits ) // "/*" route is deprecated, and kept for backward compatibility
15621556 }, repo .MustBeNotEmpty )
15631557
15641558 m .Group ("/blame" , func () {
0 commit comments