summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2020-03-27 14:38:49 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2020-03-27 15:12:48 +0000
commit769ff77c9c5afaec97350a4931e5ca123b6af6d2 (patch)
treebfb85bc6c69d4b6a08905304df7141b633a4e226 /scripts
parentb9166baebe70a4b3577ddb6b2ee6af0dd4f60759 (diff)
downloadlibvirt-769ff77c9c5afaec97350a4931e5ca123b6af6d2.tar.gz
scripts: avoid error in DCO check on empty branches
If the DCO check is run on an empty branch (ie one which has no commits different from master), it throws an error due to trying to interpret the empty string as a git commit SHA. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/require-dco.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/require-dco.py b/scripts/require-dco.py
index 9fe13823a9..ae94393319 100755
--- a/scripts/require-dco.py
+++ b/scripts/require-dco.py
@@ -46,7 +46,10 @@ print("\nChecking for 'Signed-off-by: NAME <EMAIL>' on all commits since %s...\n
log = subprocess.check_output(["git", "log", "--format=%H %s", ancestor + "..."],
universal_newlines=True)
-commits = [[c[0:40], c[41:]] for c in log.strip().split("\n")]
+if log == "":
+ commits = []
+else:
+ commits = [[c[0:40], c[41:]] for c in log.strip().split("\n")]
for sha, subject in commits: