From 54f7e603e8ffe7424869926a6d8debd3b29abba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Thu, 27 Jul 2017 12:38:13 +0100 Subject: _artifactcache/pushreceive.py: Verify that we have the commit objects --- buildstream/_artifactcache/pushreceive.py | 6 ++++++ 1 file changed, 6 insertions(+) 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])) -- cgit v1.2.1