- Notifications
You must be signed in to change notification settings - Fork 317
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Steps to Reproduce
- Initialize a new Git repository and set the
core.autocrlfconfiguration tofalse:
git init git config core.autocrlf false - Create a new text document with the following contents, ensuring it uses Windows-style line endings (CRLF):
test1 test3 - Stage and commit the initial version of the file:
git add * git commit -m 'first commit' - Modify the text file to the following, replacing the line between test1 and test3:
test1 test2 test3 Open sourcegit. Ensure the right panel displays changes (with Ignore Whitespace Changes disabled):

- Stage the hunk (
Ctrl+S) and observe that something is staged, but an un-stageable hunk remains visible in the right panel:

- Now run the following commands to commit the staged change and reset the un-stageable one:
git commit -m 'second commit' git reset --hard - Check the text file. You should see that the modified line now has a Linux-style EOL character (LF).
Expected Behavior
The line endings remain consistent with the original Windows-style CRLF after setting autocrlf = false, even when making partial stages and discards.
Actual Behavior
The line endings are converted to Linux-style LF when the changes are staged, instead of retaining the original CRLF.
I checked and everything works as expected when the text file contains only LF EOLs.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working