summaryrefslogtreecommitdiff
path: root/BaseTools/Scripts/PatchCheck.py
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2015-12-18 06:44:53 +0000
committervanjeff <vanjeff@Edk2>2015-12-18 06:44:53 +0000
commita166931e9404a5b42aa9955282d21d09a0a5df6d (patch)
treebdc63200ee686c76727166da40e28ffbb6ae914e /BaseTools/Scripts/PatchCheck.py
parent7da20f7b917cf7c501c452db8f90b700e5d49cd1 (diff)
downloadedk2-platforms-a166931e9404a5b42aa9955282d21d09a0a5df6d.tar.xz
BaseTools PatchCheck.py: Support binary diff
This allows a patch with binary data that is generated with --binary to be parsed by the PatchCheck.py script. (Sync patch r19104 from main trunk.) 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/branches/UDK2015@19371 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Scripts/PatchCheck.py')
-rw-r--r--BaseTools/Scripts/PatchCheck.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 340a9972b8..455c1309b6 100644
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -285,6 +285,10 @@ class GitDiffCheck:
self.set_filename(line[6:].rstrip())
if line.startswith('@@ '):
self.state = PATCH
+ self.binary = False
+ elif line.startswith('GIT binary patch'):
+ self.state = PATCH
+ self.binary = True
else:
ok = False
for pfx in self.pre_patch_prefixes:
@@ -294,6 +298,8 @@ class GitDiffCheck:
self.format_error("didn't find diff hunk marker (@@)")
self.line_num += 1
elif self.state == PATCH:
+ if self.binary:
+ pass
if line.startswith('-'):
pass
elif line.startswith('+'):