Skip to content

Regression: PR commits list includes unrelated commits after fafd1db1 #36483

@tyroneyeh

Description

@tyroneyeh

Description

Hi @lunny

After commit #36186 fafd1db1 on main, the Pull Request Commits tab may include
commits from other PRs that were merged into the target branch (main),
even though those commits are not reachable from the PR branch itself.

The PR branch history is correct (git log is clean), but the Gitea UI
incorrectly shows extra commits in Pull request → Commits.

This behavior did not occur before fafd1db1, so this appears to be a regression.


Gitea version

  • Branch: main
  • First bad commit: fafd1db1

Reproduction steps

  1. Create PR1 from main (do not merge it).
  2. Create PR2 from main (independent from PR1).
  3. Merge PR2 into main.
  4. Open PR1 and go to Pull request → Commits.

Expected behavior

The commits list of PR1 should only include commits that are reachable
from the PR1 branch and not yet merged into main.


Actual behavior

The commits list of PR1 also includes commits from PR2,
even though those commits are not present in the PR1 branch.


Verification

The PR branch history itself is correct:

git log PR1_branch --oneline

Gitea Version

main fafd1db

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Image Image

Git Version

No response

Operating System

No response

How are you running Gitea?

command-line

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions