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 12:38:57 +0100 |
commit | 54f7e603e8ffe7424869926a6d8debd3b29abba5 (patch) | |
tree | 2349059a0efa13dcb2b0a0db99db829b3df736ce | |
parent | 330615135053957b34a250ea919ecddeb67e82b3 (diff) | |
download | buildstream-pushreceive.tar.gz |
_artifactcache/pushreceive.py: Verify that we have the commit objectspushreceive
-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 3603e083d..93be2b6b9 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])) |