@@ -1332,7 +1332,7 @@ func registerRoutes(m *web.Router) {
1332
1332
1333
1333
m .Group ("/{username}/{reponame}" , func () { // repo tags
1334
1334
m .Group ("/tags" , func () {
1335
- m .Get ("" , repo .TagsList )
1335
+ m .Get ("" , context . RepoRefByDefaultBranch () /* for the "commits" tab */ , repo .TagsList )
1336
1336
m .Get (".rss" , feedEnabled , repo .TagsListFeedRSS )
1337
1337
m .Get (".atom" , feedEnabled , repo .TagsListFeedAtom )
1338
1338
m .Get ("/list" , repo .GetTagList )
@@ -1522,8 +1522,8 @@ func registerRoutes(m *web.Router) {
1522
1522
1523
1523
m .Group ("/branches" , func () {
1524
1524
m .Get ("/list" , repo .GetBranchesList )
1525
- m .Get ("" , repo .Branches )
1526
- }, repo .MustBeNotEmpty , context . RepoRef () )
1525
+ m .Get ("" , context . RepoRefByDefaultBranch () /* for the "commits" tab */ , repo .Branches )
1526
+ }, repo .MustBeNotEmpty )
1527
1527
1528
1528
m .Group ("/media" , func () {
1529
1529
m .Get ("/blob/{sha}" , repo .DownloadByIDOrLFS )
@@ -1567,8 +1567,10 @@ func registerRoutes(m *web.Router) {
1567
1567
m .Get ("/graph" , repo .Graph )
1568
1568
m .Get ("/commit/{sha:([a-f0-9]{7,64})$}" , repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .Diff )
1569
1569
m .Get ("/commit/{sha:([a-f0-9]{7,64})$}/load-branches-and-tags" , repo .LoadBranchesAndTags )
1570
- m .Get ("/cherry-pick/{sha:([a-f0-9]{7,64})$}" , repo .SetEditorconfigIfExists , repo .CherryPick )
1571
- }, repo .MustBeNotEmpty , context .RepoRef ())
1570
+
1571
+ // FIXME: this route `/cherry-pick/{sha}` doesn't seem useful or right, the new code always uses `/_cherrypick/` which could handle branch name correctly
1572
+ m .Get ("/cherry-pick/{sha:([a-f0-9]{7,64})$}" , repo .SetEditorconfigIfExists , context .RepoRefByDefaultBranch (), repo .CherryPick )
1573
+ }, repo .MustBeNotEmpty )
1572
1574
1573
1575
m .Get ("/rss/branch/*" , context .RepoRefByType (git .RefTypeBranch ), feedEnabled , feed .RenderBranchFeed )
1574
1576
m .Get ("/atom/branch/*" , context .RepoRefByType (git .RefTypeBranch ), feedEnabled , feed .RenderBranchFeed )
0 commit comments