-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Description
Description
The compare button in the PR timeline showing up when doing force pushes does not show the correct results in special cases.
To Reproduce:
- Create a repo, initialize it with at least one commit on
master - Create a new branch
new_branchfrommasterwith at least n+1 commits (n>0) - Create a PR from
new_branchintomaster - Use an interactive rebase to drop the last commit from
new_branchlocally - Use a force push to update the PR
- Click the most recently added "Compare" button
Expected Behaviour:
- Comparison showing the actual diff of the last commit which has been dropped
Behaviour:
- Empty comparison stating "These branches are equal"
Worth mentioning:
When changing the order of the commits in the compare URL, the diff shows up. I would expect changing the order of commits in the compare URL to only change the removed/added state of lines but not showing a diff vs. not showing a diff at all.
This used to work in the past - however I'm not exactly sure when this behaviour got introduced. I guess it should be possible to figure out with some bisect approach.
Unfortunately I'm not able to provide a demo of the bug on the gitea demo site - I'm not not able to login there due to internal server errors and timeouts.
Gitea Version
1.25.3
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
PR after force push with the compare button:

Here you end up when clicking the compare button:

This is after manually changing the order of commit ids in the compare url:

Git Version
2.49.1 (coming with gitea docker image)
Operating System
Ubuntu 22.04
How are you running Gitea?
Gitea runs in a docker container using the official gitea docker image.
Database
SQLite