Skip to content

Gitea should not convert newlines when editing a file through the web interface #27136

@anthonyvdotbe

Description

@anthonyvdotbe

Description

When editing a file through the web interface, Gitea converts CRLF newlines to LF.

The expected behavior would be for Gitea to apply the actual changes I make in the editor, use the original newlines from the file, and commit the file. Then Git (via properties such as core.autocrlf) would decide whether the newlines must be converted.

In other words, Gitea shouldn't be opinionated about newlines (even for new files, Gitea could offer a dropdown to choose the newlines to use).

Gitea Version

1.20.4

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.41 (git version 2.41.0.windows.1)

Operating System

Windows 11 (Microsoft Windows 10.0.22621)

How are you running Gitea?

Using the official gitea-1.20.4-windows-4.0-amd64.exe, running as a Windows service as described in the Gitea docs.

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions