mirror of
https://github.com/scummvm/dockerized-bb.git
synced 2026-06-20 05:46:00 +00:00
CHECK-VERSIONS: Allow to specify short commit numbers
This commit is contained in:
@@ -123,7 +123,7 @@ def fetch_refs(repository, context=None):
|
||||
refs = parse_dumb_refs(reply)
|
||||
return refs
|
||||
|
||||
def git_commit(version, *, repository, branch, context=None):
|
||||
def git_commit(version, *, repository, branch, context=None, short=False):
|
||||
refs = fetch_refs(repository, context)
|
||||
|
||||
ref_name = 'refs/heads/{0}'.format(branch)
|
||||
@@ -132,6 +132,9 @@ def git_commit(version, *, repository, branch, context=None):
|
||||
if obj is None:
|
||||
raise Exception("Invalid branch {1} specified for {0}".format(repository, branch))
|
||||
|
||||
if short and len(version) >= 7:
|
||||
obj = obj[:len(version)]
|
||||
|
||||
return obj == version, obj, "repository URL: {0} branch {1}".format(repository, branch)
|
||||
|
||||
checkers.register('git commit', git_commit)
|
||||
|
||||
Reference in New Issue
Block a user