-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Description
Gitea incorrectly auto-closes an issue if you force-push to a PR referencing that issue, even though the PR is still open and not merged into the main branch.
Steps to reproduce
-
Create a repo with a single file
README.md
. -
Create issue "A" in that repo
-
Create a new branch "<issue_number>-A" for the issue, add some changes to
README.md
, commit them with message "closes #<issue_number>" to enable auto-close when the branch is merged, and push it -
Create a pull request based on branch "<issue_number>-A" above
-
Link the issue to the pull request branch "<issue_number>-A"
-
Create a second branch "B" based on "main", add a change to
README.md
that conflicts with a change in branch "<issue_number>-A", and push it -
Create a pull request for the second branch "B", and merge it using "Rebase
then fast-forward" and selecting "Delete Branch "B"" -
Pull the updated "main" branch locally, switch to branch "<issue_number>-A", and run
git rebase main
-
Resolve the conflict in
README.md
keeping both changes, and rungit add README.md
, thengit rebase --continue
-
Run
git push --force-with-lease
Result
Issue "A" is auto-closed (see https://demo.gitea.com/reimer-atb/test/issues/1)
even though the PR is still open and branch "<issue_number>-A" has not been merged into "main" (see https://demo.gitea.com/reimer-atb/test/pulls/2).
Expected result
Issue "A" should remain "open". It should only be auto-closed when the PR is merged into "main".
Gitea Version
1.23.5 and 1.24.0+dev-424-g403775e74e
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
2.49.0
Operating System
No response
How are you running Gitea?
I used demo.gitea.com. It also happens on our gitea instance (version 1.23.5). But I don't manage that and don't know what it runs on.
Database
None