Procházet zdrojové kódy

pack: Fix Pack.__getitem__ return type

It returns ShaFile type not bytes.
Antoine Lambert před 2 roky
rodič
revize
4bc3203963
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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)