]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools PatchCheck.py: Support binary diff
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 3 Dec 2015 08:18:00 +0000 (08:18 +0000)
committerjljusten <jljusten@Edk2>
Thu, 3 Dec 2015 08:18:00 +0000 (08:18 +0000)
This allows a patch with binary data that is generated with --binary
to be parsed by the PatchCheck.py script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19104 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Scripts/PatchCheck.py

index 340a9972b8382e00a42a229edb52efde7107913e..455c1309b6d3c785adff3378172933844ac23d1c 100755 (executable)
@@ -285,6 +285,10 @@ class GitDiffCheck:
                 self.set_filename(line[6:].rstrip())\r
             if line.startswith('@@ '):\r
                 self.state = PATCH\r
+                self.binary = False\r
+            elif line.startswith('GIT binary patch'):\r
+                self.state = PATCH\r
+                self.binary = True\r
             else:\r
                 ok = False\r
                 for pfx in self.pre_patch_prefixes:\r
@@ -294,6 +298,8 @@ class GitDiffCheck:
                     self.format_error("didn't find diff hunk marker (@@)")\r
             self.line_num += 1\r
         elif self.state == PATCH:\r
+            if self.binary:\r
+                pass\r
             if line.startswith('-'):\r
                 pass\r
             elif line.startswith('+'):\r