Răsfoiți Sursa

pack: Fix Pack.__getitem__ return type

It returns ShaFile type not bytes.
Antoine Lambert 2 ani în urmă
părinte
comite
4bc3203963
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      dulwich/pack.py

+ 1 - 1
dulwich/pack.py

@@ -2395,7 +2395,7 @@ class Pack:
         type_num, chunks = self.resolve_object(offset, obj_type, obj)
         return type_num, b"".join(chunks)
 
-    def __getitem__(self, sha1: bytes) -> bytes:
+    def __getitem__(self, sha1: bytes) -> ShaFile:
         """Retrieve the specified SHA1."""
         type, uncomp = self.get_raw(sha1)
         return ShaFile.from_raw_string(type, uncomp, sha=sha1)