Skip to content

404 Response after successfully applying patch from diff file #22621

@pahofmann

Description

@pahofmann

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions