@@ -1332,7 +1332,7 @@ func registerRoutes(m *web.Router) {
13321332
13331333 m .Group ("/{username}/{reponame}" , func () { // repo tags
13341334 m .Group ("/tags" , func () {
1335- m .Get ("" , repo .TagsList )
1335+ m .Get ("" , context . RepoRefByDefaultBranch () /* for the "commits" tab */ , repo .TagsList )
13361336 m .Get (".rss" , feedEnabled , repo .TagsListFeedRSS )
13371337 m .Get (".atom" , feedEnabled , repo .TagsListFeedAtom )
13381338 m .Get ("/list" , repo .GetTagList )
@@ -1522,8 +1522,8 @@ func registerRoutes(m *web.Router) {
15221522
15231523 m .Group ("/branches" , func () {
15241524 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 )
15271527
15281528 m .Group ("/media" , func () {
15291529 m .Get ("/blob/{sha}" , repo .DownloadByIDOrLFS )
@@ -1567,8 +1567,10 @@ func registerRoutes(m *web.Router) {
15671567 m .Get ("/graph" , repo .Graph )
15681568 m .Get ("/commit/{sha:([a-f0-9]{7,64})$}" , repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .Diff )
15691569 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 )
15721574
15731575 m .Get ("/rss/branch/*" , context .RepoRefByType (git .RefTypeBranch ), feedEnabled , feed .RenderBranchFeed )
15741576 m .Get ("/atom/branch/*" , context .RepoRefByType (git .RefTypeBranch ), feedEnabled , feed .RenderBranchFeed )
0 commit comments