]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/PatchCheck: Ignore blank lines in diff
authorMichael D Kinney <michael.d.kinney@intel.com>
Thu, 1 Aug 2019 22:57:18 +0000 (15:57 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Thu, 8 Aug 2019 05:11:42 +0000 (22:11 -0700)
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>
BaseTools/Scripts/PatchCheck.py

index 6aec15d0f0b23bd58c13efac5b0ecf3c5457f36e..4f2ef81ae7ab685364a9311b1aa96552da2dfa3c 100755 (executable)
@@ -270,6 +270,7 @@ class GitDiffCheck:
             if line.startswith('@@ '):\r
                 self.state = PRE_PATCH\r
             elif len(line) >= 1 and line[0] not in ' -+' and \\r
+                 not line.startswith('\r\n') and  \\r
                  not line.startswith(r'\ No newline ') and not self.binary:\r
                 for line in self.lines[self.line_num + 1:]:\r
                     if line.startswith('diff --git'):\r
@@ -313,6 +314,8 @@ class GitDiffCheck:
                 pass\r
             elif line.startswith('+'):\r
                 self.check_added_line(line[1:])\r
+            elif line.startswith('\r\n'):\r
+                pass\r
             elif line.startswith(r'\ No newline '):\r
                 pass\r
             elif not line.startswith(' '):\r