diff options
author | Jürg Billeter <j@bitron.ch> | 2017-07-27 12:38:13 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2017-07-27 15:10:02 +0100 |
commit | edb3e15acfca6c677ea0b4141c94e64209983f61 (patch) | |
tree | c13b631e04a8ee0c16ce4bb4afd77be7f3484edc | |
parent | f44da295a33f09a9294d6aa0b7782361cd7d288c (diff) | |
download | buildstream-edb3e15acfca6c677ea0b4141c94e64209983f61.tar.gz |
_artifactcache/pushreceive.py: Verify that we have the commit objects
-rw-r--r-- | buildstream/_artifactcache/pushreceive.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/buildstream/_artifactcache/pushreceive.py b/buildstream/_artifactcache/pushreceive.py index 058bd5fc6..5e83c1c99 100644 --- a/buildstream/_artifactcache/pushreceive.py +++ b/buildstream/_artifactcache/pushreceive.py @@ -583,6 +583,12 @@ class OSTreeReceiver(object): logging.debug('Renaming {} to {}'.format(tmp_path, obj_path)) os.rename(tmp_path, obj_path) + # Verify that we have the specified commit objects + for branch, revs in update_refs.items(): + _, has_object = self.repo.has_object(OSTree.ObjectType.COMMIT, revs[1], None) + if not has_object: + raise PushException('Missing commit {} for ref {}'.format(revs[1], branch)) + # Finally, update the refs for branch, revs in update_refs.items(): logging.debug('Setting ref {} to {}'.format(branch, revs[1])) |