mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-10 10:44:06 +09:00
Fix bug when review pull request commits (#35192)
Some checks failed
Some checks failed
The commit range in the UI follows a half-open, half-closed convention: (,]. When reviewing a range of commits, the beforeCommitID should be set to the commit immediately preceding the first selected commit. For single-commit reviews, we must identify and use the previous commit of that specific commit. The endpoint ViewPullFilesStartingFromCommit is currently unused and can be safely removed. Fix #35157 Replace #35184 Partially extract from #35077
This commit is contained in:
@ -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)()
|
||||
|
||||
|
Reference in New Issue
Block a user