commit fe61d0eba8abbe99778fc60f76538f880098b3a2 from: Jelmer Vernooij via: GitHub date: Thu Jan 19 11:16:23 2023 UTC Merge pull request #1131 from anlambert/pack-getitem-fix-typing pack: Fix Pack.__getitem__ return type commit - bdd3507b6b8947d2a6a94fa52b5d1a58e4b75788 commit + fe61d0eba8abbe99778fc60f76538f880098b3a2 blob - 43a1b7240ed48010287237a738419e1123ce6378 blob + 435565fbe3796931c52644f31208f03a57ee4c69 --- dulwich/pack.py +++ 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)