@@ -1461,6 +1461,35 @@ func registerRoutes(m *web.Router) {
1461
1461
)
1462
1462
// end "/{username}/{reponame}/activity"
1463
1463
1464
+ m .Group ("/{username}/{reponame}" , func () {
1465
+ m .Group ("/pulls/{index}" , func () {
1466
+ m .Get ("" , repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewIssue )
1467
+ m .Get (".diff" , repo .DownloadPullDiff )
1468
+ m .Get (".patch" , repo .DownloadPullPatch )
1469
+ m .Group ("/commits" , func () {
1470
+ m .Get ("" , context .RepoRef (), repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewPullCommits )
1471
+ m .Get ("/list" , context .RepoRef (), repo .GetPullCommits )
1472
+ m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForSingleCommit )
1473
+ })
1474
+ m .Post ("/merge" , context .RepoMustNotBeArchived (), web .Bind (forms.MergePullRequestForm {}), repo .MergePullRequest )
1475
+ m .Post ("/cancel_auto_merge" , context .RepoMustNotBeArchived (), repo .CancelAutoMergePullRequest )
1476
+ m .Post ("/update" , repo .UpdatePullRequest )
1477
+ m .Post ("/set_allow_maintainer_edit" , web .Bind (forms.UpdateAllowEditsForm {}), repo .SetAllowEdits )
1478
+ m .Post ("/cleanup" , context .RepoMustNotBeArchived (), context .RepoRef (), repo .CleanUpPullRequest )
1479
+ m .Group ("/files" , func () {
1480
+ m .Get ("" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForAllCommitsOfPr )
1481
+ m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesStartingFromCommit )
1482
+ m .Get ("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForRange )
1483
+ m .Group ("/reviews" , func () {
1484
+ m .Get ("/new_comment" , repo .RenderNewCodeCommentForm )
1485
+ m .Post ("/comments" , web .Bind (forms.CodeCommentForm {}), repo .SetShowOutdatedComments , repo .CreateCodeComment )
1486
+ m .Post ("/submit" , web .Bind (forms.SubmitReviewForm {}), repo .SubmitReview )
1487
+ }, context .RepoMustNotBeArchived ())
1488
+ })
1489
+ })
1490
+ }, ignSignIn , context .RepoAssignment , repo .MustAllowPulls , reqRepoPullsReader )
1491
+ // end "/{username}/{reponame}/pulls/{index}": repo pull request
1492
+
1464
1493
m .Group ("/{username}/{reponame}" , func () {
1465
1494
m .Group ("/activity_author_data" , func () {
1466
1495
m .Get ("" , repo .ActivityAuthors )
@@ -1499,32 +1528,6 @@ func registerRoutes(m *web.Router) {
1499
1528
return cancel
1500
1529
})
1501
1530
1502
- m .Group ("/pulls/{index}" , func () {
1503
- m .Get ("" , repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewIssue )
1504
- m .Get (".diff" , repo .DownloadPullDiff )
1505
- m .Get (".patch" , repo .DownloadPullPatch )
1506
- m .Group ("/commits" , func () {
1507
- m .Get ("" , context .RepoRef (), repo .SetWhitespaceBehavior , repo .GetPullDiffStats , repo .ViewPullCommits )
1508
- m .Get ("/list" , context .RepoRef (), repo .GetPullCommits )
1509
- m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForSingleCommit )
1510
- })
1511
- m .Post ("/merge" , context .RepoMustNotBeArchived (), web .Bind (forms.MergePullRequestForm {}), repo .MergePullRequest )
1512
- m .Post ("/cancel_auto_merge" , context .RepoMustNotBeArchived (), repo .CancelAutoMergePullRequest )
1513
- m .Post ("/update" , repo .UpdatePullRequest )
1514
- m .Post ("/set_allow_maintainer_edit" , web .Bind (forms.UpdateAllowEditsForm {}), repo .SetAllowEdits )
1515
- m .Post ("/cleanup" , context .RepoMustNotBeArchived (), context .RepoRef (), repo .CleanUpPullRequest )
1516
- m .Group ("/files" , func () {
1517
- m .Get ("" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForAllCommitsOfPr )
1518
- m .Get ("/{sha:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesStartingFromCommit )
1519
- m .Get ("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}" , context .RepoRef (), repo .SetEditorconfigIfExists , repo .SetDiffViewStyle , repo .SetWhitespaceBehavior , repo .SetShowOutdatedComments , repo .ViewPullFilesForRange )
1520
- m .Group ("/reviews" , func () {
1521
- m .Get ("/new_comment" , repo .RenderNewCodeCommentForm )
1522
- m .Post ("/comments" , web .Bind (forms.CodeCommentForm {}), repo .SetShowOutdatedComments , repo .CreateCodeComment )
1523
- m .Post ("/submit" , web .Bind (forms.SubmitReviewForm {}), repo .SubmitReview )
1524
- }, context .RepoMustNotBeArchived ())
1525
- })
1526
- }, repo .MustAllowPulls )
1527
-
1528
1531
m .Group ("/media" , func () {
1529
1532
m .Get ("/branch/*" , context .RepoRefByType (context .RepoRefBranch ), repo .SingleDownloadOrLFS )
1530
1533
m .Get ("/tag/*" , context .RepoRefByType (context .RepoRefTag ), repo .SingleDownloadOrLFS )
0 commit comments