[git-llvm] Fix some issues surrouding EOL conversion on Windows.
authorZachary Turner <zturner@google.com>
Tue, 9 Oct 2018 23:42:28 +0000 (23:42 +0000)
committerZachary Turner <zturner@google.com>
Tue, 9 Oct 2018 23:42:28 +0000 (23:42 +0000)
commite5f47bbeaccb3778bc604d29f8768ccbc400ceca
tree86f6f0ad14fa3012c1e0b5d2f2c820cd46d428d4
parent409f5840a7b661ef6ed02a9dea839446a8b9f8c3
[git-llvm] Fix some issues surrouding EOL conversion on Windows.

This patch fixes three issues.

The first is that we didn't consider files which are explicitly
set to eolstyle CRLF in the repo, and there are a handful of
these.

Second is that dos2unix doesn't have a -q option in GnuWin32,
so this codepath wasn't working properly.

Finally with newer versions of Python (or newer versions of Git,
or some combination of the two) patches can't be applied when
we treat stdin as text, because Python silently undoes all the
work we did to convert the newlines to LF using dos2unix by
using universal_newlines=True and then converting them *back*
to CRLF.  So we need to add a way to force stdin to be treated
as binary, and use it when LF-newlines are required.

Differential Revision: https://reviews.llvm.org/D51444

llvm-svn: 344095
llvm/utils/git-svn/git-llvm