Skip to content

Commit

Permalink
pack: Fix Pack.__getitem__ return type
Browse files Browse the repository at this point in the history
It returns ShaFile type not bytes.
  • Loading branch information
anlambert committed Jan 19, 2023
1 parent bdd3507 commit 4bc3203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dulwich/pack.py
Expand Up @@ -2395,7 +2395,7 @@ def get_raw(self, sha1: bytes) -> Tuple[int, bytes]:
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)
Expand Down

0 comments on commit 4bc3203

Please sign in to comment.