-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Allow empty commit when merging pull request with squash style #35989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Why user can't provide a message? What's the use case for keeping the message empty? |
It's an empty commit, not an empty commit message. |
OK, then why an empty commit should be supported? What's the use case |
I updated the issue content. Looks at the image on that. The previous implementation in Gitea has a warning hint there but it said |
|
Without the If it tests nothing, you can delete the test to avoid wasting CI time. |
|
I'm confused because the screenshot shows "1 files changed", but a empty commit would actually be "0 files changed". Are you sure it's targeting the correct mechanism? |
That's how git works.
|
|
So basically a branch that once had changes, but was then made to match the target branch. I still think the UI should show "0 changed files" in such a case as I'm pretty sure |
No. The "diff" is from its merge base. If you want to see 0, click that "Update branch" button. |
|
How to reproduce the issue: |
|
Yep, it can be reproduced if there is nothing to merge. My comment #35989 (comment) can also easily reproduce. But the problem is: your test code is not right
|
Before this PR, when merging an empty PR with squash style will result in 500.
How to reproduce the issue:
1. Create a new branch dev from main.
2. Add some changes and commit them on the dev branch.
3. Open a pull request from dev to main.
4. Manually cherry-pick the commit from dev into main.
5. Open the pull request page and attempt a Squash Merge → a 500 error occurs.
This PR will allow the behavior.