From cc62a937729ab3d3d8b45db632476a8ef08f3037 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 15 Jul 2025 17:07:12 -0700 Subject: [PATCH] Remove unused router and test --- routers/web/repo/pull.go | 4 ---- routers/web/web.go | 1 - tests/integration/pull_diff_test.go | 4 ---- 3 files changed, 9 deletions(-) diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index 9c11a8453e5..5e7a67ac0c5 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -897,10 +897,6 @@ func ViewPullFilesForRange(ctx *context.Context) { viewPullFiles(ctx, ctx.PathParam("shaFrom"), ctx.PathParam("shaTo")) } -func ViewPullFilesStartingFromCommit(ctx *context.Context) { - viewPullFiles(ctx, ctx.PathParam("sha"), "") -} - func ViewPullFilesForAllCommitsOfPr(ctx *context.Context) { viewPullFiles(ctx, "", "") } diff --git a/routers/web/web.go b/routers/web/web.go index f8612db504d..5850b0fcaf5 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -1540,7 +1540,6 @@ func registerWebRoutes(m *web.Router) { m.Post("/cleanup", context.RepoMustNotBeArchived(), repo.CleanUpPullRequest) m.Group("/files", func() { m.Get("", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForAllCommitsOfPr) - m.Get("/{sha:[a-f0-9]{7,40}}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesStartingFromCommit) m.Get("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForRange) m.Group("/reviews", func() { m.Get("/new_comment", repo.RenderNewCodeCommentForm) diff --git a/tests/integration/pull_diff_test.go b/tests/integration/pull_diff_test.go index 54112509358..0b286fd2b29 100644 --- a/tests/integration/pull_diff_test.go +++ b/tests/integration/pull_diff_test.go @@ -25,10 +25,6 @@ func TestPullDiff_CommitRangePRDiff(t *testing.T) { doTestPRDiff(t, "/user2/commitsonpr/pulls/1/files/4ca8bcaf27e28504df7bf996819665986b01c847..23576dd018294e476c06e569b6b0f170d0558705", true, []string{"test2.txt", "test3.txt", "test4.txt"}) } -func TestPullDiff_StartingFromBaseToCommitPRDiff(t *testing.T) { - doTestPRDiff(t, "/user2/commitsonpr/pulls/1/files/c5626fc9eff57eb1bb7b796b01d4d0f2f3f792a2", true, []string{"test1.txt", "test2.txt", "test3.txt"}) -} - func doTestPRDiff(t *testing.T, prDiffURL string, reviewBtnDisabled bool, expectedFilenames []string) { defer tests.PrepareTestEnv(t)()