summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2017-06-15 14:57:30 +0300
committerBen Pfaff <blp@ovn.org>2017-06-15 21:46:35 -0700
commit057653abfba0b7dd0d86defc394ec0624414c780 (patch)
treef34be546458a1ad271966edf6e202bda4d82ba17 /utilities
parentbf090264e68d160d0ae70ebc93d59bc09d34cc8b (diff)
downloadopenvswitch-057653abfba0b7dd0d86defc394ec0624414c780.tar.gz
checkpatch: Fix skipping of the most recent commit.
'range(n_patches, 0, -1)' generates list starting from 'n_patches' and not including zero. This leads to checking of N most recent commits starting from the second one. New version will generate right list starting from 'n_patches - 1' and including zero. So, the most recent commit (HEAD~0) will be checked and desired behavior will be achieved. Also, 'reversed' looks better than 'range(n_patches - 1, -1, -1)' Fixes: a1fccabce2cb ("checkpatch: Support checking recent commits in the current repo.") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'utilities')
-rwxr-xr-xutilities/checkpatch.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 243a43027..b45a255ce 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -480,7 +480,7 @@ if __name__ == '__main__':
if n_patches:
status = 0
- for i in range(n_patches, 0, -1):
+ for i in reversed(range(0, n_patches)):
revision = 'HEAD~%d' % i
f = os.popen('git format-patch -1 --stdout %s' % revision, 'r')
patch = f.read()