Add code for computing which line-ending to use based on configuration
authorBoris Feld <boris.feld@comet.ml>
Tue, 11 Dec 2018 08:17:37 +0000 (09:17 +0100)
committerBoris Feld <boris.feld@comet.ml>
Tue, 11 Dec 2018 08:17:37 +0000 (09:17 +0100)
commitba3f97d1a5a4f0af5a05a7ff4dd55ce85545b0e6
tree217f90543a3a425925a79678ec74c2be70047983
parent78280f137e18769d6ed4247394ae789d9dbac129
Add code for computing which line-ending to use based on configuration

The implementation is based in my interpretation of several sources of documentation:
- man gitconfig for core.eol and core.autocrlf
- man gitattributes for line-ending conversion
- https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/

It doesn't support gitattributes overriding, it should be easy enough to add
the logic in the functions introduced in the next commit.
dulwich/line_ending.py
dulwich/tests/test_line_ending.py