Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066566
D8202.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
D8202.diff
View Options
diff --git a/swh/model/model.py b/swh/model/model.py
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -743,7 +743,9 @@
id = attr.ib(type=Sha1Git, validator=type_validator(), default=b"", repr=hash_repr)
def _compute_hash_from_attributes(self) -> bytes:
- return _compute_hash_from_manifest(git_objects.snapshot_git_object(self))
+ return _compute_hash_from_manifest(
+ git_objects.snapshot_git_object(self, ignore_unresolved=True)
+ )
@classmethod
def from_dict(cls, d):
diff --git a/swh/model/tests/test_identifiers.py b/swh/model/tests/test_identifiers.py
--- a/swh/model/tests/test_identifiers.py
+++ b/swh/model/tests/test_identifiers.py
@@ -755,8 +755,9 @@
)
def test_unresolved(self):
- with self.assertRaisesRegex(ValueError, "b'foo' -> b'bar'"):
- Snapshot.from_dict(remove_id(self.unresolved))
+ self.assertEqual(
+ Snapshot.from_dict(remove_id(self.unresolved)).id, self.unresolved["id"]
+ )
def test_git_object_unresolved(self):
with self.assertRaisesRegex(ValueError, "b'foo' -> b'bar'"):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 3:15 PM (12 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216993
Attached To
D8202: model: Allow unresolved branches when computing Snapshot hash
Event Timeline
Log In to Comment