Skip to content
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

404 Response after successfully applying patch from diff file #22621

Closed
pahofmann opened this issue Jan 27, 2023 · 3 comments · Fixed by #23056 or #23086
Closed

404 Response after successfully applying patch from diff file #22621

pahofmann opened this issue Jan 27, 2023 · 3 comments · Fixed by #23056 or #23086
Labels
Milestone

Comments

@pahofmann
Copy link

pahofmann commented Jan 27, 2023

Description

When applying a patch (via code tab -> Add File -> Apply Patch) the patch is applied correctly, but the server responds with a 404. The after creating the patch commit the redirect that 404s is for USER/REPOSITORY/branch/main/diff.patch, which does not exist of course.

I could reproduce it here:
https://try.gitea.io/pahofmann/patch-404-test/
After I applied the patch I was redirected to https://try.gitea.io/pahofmann/patch-404-test/src/branch/main/diff.patch

Gitea Version

1.18.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/pahofmann/fb2c2e9daa8ff8d2c846b85e1eca3598

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Fresh setup in container.

Database

SQLite

@yp05327
Copy link
Contributor

yp05327 commented Feb 22, 2023

I reproduced this bug and got incorrect commits count in the latest version.
image

Edit: If you restart the server, it will be correct again.

Issue here

@yp05327
Copy link
Contributor

yp05327 commented Feb 22, 2023

And the default commit name in form is Update '', but the real commit name will be Apply Patch
image

@yp05327
Copy link
Contributor

yp05327 commented Feb 24, 2023

I don't think this issue can be closed, as the main fix PR is #23056 which is not closed.

yardenshoham pushed a commit to yardenshoham/gitea that referenced this issue Feb 24, 2023
zeripath pushed a commit to zeripath/gitea that referenced this issue Feb 24, 2023
techknowlogick pushed a commit that referenced this issue Feb 25, 2023
lunny pushed a commit that referenced this issue Mar 15, 2023
…t name in Apply Patch page (#23086) (#23131)

Backport #23056
Backport #23086

Fixes #22621

Fixes
#22621 (comment)

Co-authored-by: yp05327 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants