Page MenuHomeSoftware Heritage

D8527.id30726.diff
No OneTemporary

D8527.id30726.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, 11:48 AM (17 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222976

Event Timeline