Skip to content

hunk diff doesn't respect Git line-ending normalization #818

Description

@bagatka

What happened?

Git can store a text file with LF while checking it out with CRLF, e.g. with:

*.ts text eol=crlf in .gitattributes

Steps to reproduce

  1. Add the rule above to .gitattributes.
  2. Check out a matching file.
  3. Modify one line.
  4. Run git diff -- only that line is changed.
  5. Run hunk diff -- the whole file is shown as removed and added.

git diff --no-color | hunk patch - renders correctly.

Expected behavior

hunk diff should respect Git line-ending normalization

Version

0.19.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions