Retain newline style when generating diffs
Summary: Builds on D3441, D3440. Instead of exploding on "\r?\n" and then imploding on "\n", retain newline style throughout parsing.
Test Plan:
All unit tests pass (the parser has substantial existing coverage). These new tests pass in the git commit-by-commit test case:
commit
176a4c2c3fd88b2d598ce41a55d9c3958be9fd2d
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:56:08 2012 -0700
Convert \r\n newlines to \n newlines.
commit
a73b28e139296d23ade768f2346038318b331f94
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:55:31 2012 -0700
Add text with \r\n newlines.
commit
337ccec314075a2bdb4a912ef467d35d04a713e4
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:55:13 2012 -0700
Convert \n newlines to \r\n newlines.
commit
6d5e64a4a7a6a036c53b1d087184cb2c70099f2c
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:53:39 2012 -0700
Remove tabs.
commit
49395994a1a8a06287e40a3b318be4349e8e0288
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:53:33 2012 -0700
Add tabs.
commit
a5a53c424f3c2a7e85f6aee35e834c8ec5b3dbe3
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:52:57 2012 -0700
Add trailing newline.
commit
d53dc614090c6c7d6d023e170877d7f611f18f5a
Author: epriestley <git@epriestley.com>
Date: Wed Sep 5 14:52:41 2012 -0700
Remove trailing newline.
Previously, the newline-related tests failed.
Reviewers: vrana, btrahan
Reviewed By: vrana
CC: aran
Maniphest Tasks: T866
Differential Revision: https://secure.phabricator.com/D3442