sourcetree modifies line endings in an unwanted way. i noticed this behaviour at least 6 months ago, so it's quite an old bug.
in the first round i tried to resolve it here:
https://answers.atlassian.com/questions/5703353/answers/9375631?flashId=362096352
repro:
i have a file in stash, that has only one hunk in it. i will attach stashed patch, and few versions of the modified file.
1) clean repository:
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
2) apply stash:
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
3) select green line
discard green line by clicking at 'discard lines'
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF line terminators
4) discard hunk
$ file /d/src/lib/onExit.cpp
/d/src/lib/onExit.cpp: C++ source, ASCII text, with CRLF, LF line terminators
- duplicates
-
SRCTREEWIN-2377 Windows Linebreaks are replaced with Unix breaks on "Discard Hunk" click
- Closed