[PatchCheck] Skip CRLF check in git .patch files

GIT allows only UNIX format in .patch file. Otherwise, git am or apply
will report 'fatal: git apply: bad git-diff - expected /dev/null'.
But, PatchCheck blocks non-CRLF changes in commit. It's mutual exclusive.
Therefore, skip CRLF check in git .patch files.

Signed-off-by: Aiden Park <aiden.park@intel.com>
This commit is contained in:
Aiden Park 2019-12-11 12:23:43 -08:00
parent 7e731e1cfb
commit 2105a49e04
1 changed files with 643 additions and 643 deletions

View File

@ -369,7 +369,7 @@ class GitDiffCheck:
stripped = line.rstrip()
if self.force_crlf and eol != '\r\n':
if self.force_crlf and eol != '\r\n' and not self.filename.endswith('.patch'):
self.added_line_error('Line ending (%s) is not CRLF' % repr(eol),
line)
if '\t' in line: