summaryrefslogtreecommitdiff
path: root/BaseTools/Scripts
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2019-08-01 15:57:18 -0700
committerMichael D Kinney <michael.d.kinney@intel.com>2019-08-07 22:11:42 -0700
commit05579e51824a1ea393e52a3bda7d0c35cb060bc3 (patch)
treecc29f8ecdf336d327586a7009516d0f41b8cfac7 /BaseTools/Scripts
parent111bbcf87621953dc6ceff09f6c953d33c2689d6 (diff)
BaseTools/PatchCheck: Ignore blank lines in diff
https://bugzilla.tianocore.org/show_bug.cgi?id=2044 When fixes are made for incorrect line endings, there are cases where the diff contains blank lines. Ignore these blank lines. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-xBaseTools/Scripts/PatchCheck.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 6aec15d0f0..4f2ef81ae7 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -270,6 +270,7 @@ class GitDiffCheck:
if line.startswith('@@ '):
self.state = PRE_PATCH
elif len(line) >= 1 and line[0] not in ' -+' and \
+ not line.startswith('\r\n') and \
not line.startswith(r'\ No newline ') and not self.binary:
for line in self.lines[self.line_num + 1:]:
if line.startswith('diff --git'):
@@ -313,6 +314,8 @@ class GitDiffCheck:
pass
elif line.startswith('+'):
self.check_added_line(line[1:])
+ elif line.startswith('\r\n'):
+ pass
elif line.startswith(r'\ No newline '):
pass
elif not line.startswith(' '):