diff options
author | Hao Wu <hao.a.wu@intel.com> | 2017-06-08 10:58:22 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2017-06-26 09:26:56 +0800 |
commit | aab57eff5a9cdf841f1e92bb1282040987d94ff7 (patch) | |
tree | 24dbf4d9288d36775c331672093e102031b3c0f6 /BaseTools | |
parent | 16bad1fbaf897ecd93fb5046f4fed768ac12b6ff (diff) | |
download | edk2-aab57eff5a9cdf841f1e92bb1282040987d94ff7.tar.gz edk2-aab57eff5a9cdf841f1e92bb1282040987d94ff7.tar.bz2 edk2-aab57eff5a9cdf841f1e92bb1282040987d94ff7.zip |
BaseTools/PatchCheck.py: Fix misreport for binary changes in patch
For a patch file that:
1. Contains a binary change
2. Contains any other changes after the binary change
PatchCheck.py will complains with the following error:
* Patch format error: diff found after end of patch
Line: literal XXXX
This commit resolves this misreport.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rwxr-xr-x | BaseTools/Scripts/PatchCheck.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 7c3008233c..4bc697b1af 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -1,7 +1,7 @@ ## @file
# Check a patch for various format issues
#
-# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made
# available under the terms and conditions of the BSD License which
@@ -265,7 +265,7 @@ class GitDiffCheck: if line.startswith('@@ '):
self.state = PRE_PATCH
elif len(line) >= 1 and line[0] not in ' -+' and \
- not line.startswith(r'\ No newline '):
+ not line.startswith(r'\ No newline ') and not self.binary:
for line in self.lines[self.line_num + 1:]:
if line.startswith('diff --git'):
self.format_error('diff found after end of patch')
@@ -300,7 +300,7 @@ class GitDiffCheck: elif self.state == PATCH:
if self.binary:
pass
- if line.startswith('-'):
+ elif line.startswith('-'):
pass
elif line.startswith('+'):
self.check_added_line(line[1:])
|