Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7122950
D456.id1400.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D456.id1400.diff
View Options
diff --git a/swh/loader/git/updater.py b/swh/loader/git/updater.py
--- a/swh/loader/git/updater.py
+++ b/swh/loader/git/updater.py
@@ -49,14 +49,25 @@
def _cache_heads(self, origin_id, base_snapshot):
"""Return all the known head commits for `origin_id`"""
+ _git_types = ['content', 'directory', 'revision', 'release']
+
if not base_snapshot:
base_snapshot = self.storage.snapshot_get_latest(origin_id)
if base_snapshot:
- return self._decode_from_storage(
- target['target']
- for target in base_snapshot['branches'].values()
- )
+ snapshot_targets = set()
+ for target in base_snapshot['branches'].values():
+ if target and target['target_type'] in _git_types:
+ snapshot_targets.add(target['target'])
+
+ for id, objs in self.get_stored_objects(
+ self._decode_from_storage(snapshot_targets)
+ ).items():
+ if not objs:
+ logging.warn('Missing head: %s' % hashutil.hash_to_hex(id))
+ return []
+
+ return snapshot_targets
else:
return []
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 17 2024, 1:00 PM (11 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216031
Attached To
D456: Ignore local history when we miss an object
Event Timeline
Log In to Comment