Page MenuHomeSoftware Heritage

D8527.id30721.diff
No OneTemporary

D8527.id30721.diff

diff --git a/swh/model/git_objects.py b/swh/model/git_objects.py
--- a/swh/model/git_objects.py
+++ b/swh/model/git_objects.py
@@ -55,12 +55,16 @@
def directory_entry_sort_key(entry: model.DirectoryEntry):
"""The sorting key for tree entries"""
if isinstance(entry, dict):
- # For backward compatibility
- entry = model.DirectoryEntry.from_dict(entry)
- if entry.type == "dir":
- return entry.name + b"/"
+ type_ = entry["type"]
+ name = entry["name"]
+ else:
+ type_ = entry.type
+ name = entry.name
+
+ if type_ == "dir":
+ return name + b"/"
else:
- return entry.name
+ return name
@lru_cache()

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 12:06 PM (17 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222976

Event Timeline