Skip to content

New pull request notification will show wrong branch in a special case #32769

Closed
@yp05327

Description

@yp05327

Description

Sorry, this is a bug come from my PR #25812

Reproduce:

  1. create a new repo A, create a file in it
  2. fork it to repo B
  3. push a commit (the most easy way is creating a new file in web) in repo A's main branch

Then you will see:
In repo A, the branch in notification is repo B's main branch, actually the expected branch is repo A's main branch.
image
In the fork (repo B), it show the repo A's main branch, actually the expected behavior is showing nothing.
image

Reason:
For newly created empty branch (based on default branch), I want to ignore the notification, so I added this in the SQL query.
image
And this cause this bug.

In repo A, it will ignore the newly pushed commit because of the condition I mentioned above, and the default branch's latest commit id is changed. So in repo B's main branch, the latest commit id is not same to the repo A's default branch's latest commit id, so it will be picked up as a recently updated branch.

Don't have a good idea about how to fix it now. If someone is interested, it is welcome to create a PR for it.

Gitea Version

latest

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

build

Database

None

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions