chiark / gitweb /
Don't accept empty commits
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 26 Aug 2014 11:40:18 +0000 (13:40 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 26 Aug 2014 11:40:18 +0000 (13:40 +0200)
With SCMs like git, "git checkout ''" doesn't actually fail, so one may
commit builds without noticing that they left the commit empty.

fdroidserver/metadata.py

index c6a4db0a97ce50a5c87abbe43c68f2ef93c39ea6..7672de68482cd19760ec4c0b39503a2a60430ecc 100644 (file)
@@ -679,7 +679,8 @@ def parse_metadata(metafile):
         line = line.rstrip('\r\n')
         if mode == 3:
             if not any(line.startswith(s) for s in (' ', '\t')):
-                if 'commit' not in curbuild and 'disable' not in curbuild:
+                commit = curbuild['commit'] if 'commit' in curbuild else None
+                if not commit and 'disable' not in curbuild:
                     raise MetaDataException("No commit specified for {0} in {1}"
                                             .format(curbuild['version'], linedesc))