Skip to content

Commit 5f6657e

Browse files
committed
fix _pygit2.pyi again
1 parent 42b5129 commit 5f6657e

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

pygit2/_pygit2.pyi

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,19 @@ class Object:
282282
type: Literal[1, 2, 4, 3]
283283
type_str: "Literal['commit'] | Literal['tree'] | Literal['tag'] | Literal['blob']"
284284
@overload
285-
def peel(self, target_type: Literal[1] | type[Commit]) -> Commit: ...
285+
def peel(
286+
self, target_type: Literal[1, ObjectType.COMMIT] | type[Commit]
287+
) -> Commit: ...
286288
@overload
287-
def peel(self, target_type: Literal[2] | type[Tree]) -> Tree: ...
289+
def peel(self, target_type: Literal[2, ObjectType.TREE] | type[Tree]) -> Tree: ...
288290
@overload
289-
def peel(self, target_type: Literal[4] | type[Tag]) -> Tag: ...
291+
def peel(self, target_type: Literal[4, ObjectType.TAG] | type[Tag]) -> Tag: ...
290292
@overload
291-
def peel(self, target_type: Literal[3] | type[Blob]) -> Blob: ...
293+
def peel(self, target_type: Literal[3, ObjectType.BLOB] | type[Blob]) -> Blob: ...
292294
@overload
293-
def peel(self, target_type: None) -> Commit | Tree | Blob: ...
295+
def peel(
296+
self, target_type: Literal[None, ObjectType.ANY]
297+
) -> Commit | Tree | Blob: ...
294298
def read_raw(self) -> bytes: ...
295299
def __eq__(self, other: object) -> bool: ...
296300
def __ge__(self, other: object) -> bool: ...
@@ -318,13 +322,13 @@ class Reference:
318322
@overload
319323
def peel(self, type: Literal[1] | type[Commit]) -> Commit: ...
320324
@overload
321-
def peel(self, type: Literal[2] | type[Tree]) -> Tree: ...
325+
def peel(self, type: Literal[2, ObjectType.TREE] | type[Tree]) -> Tree: ...
322326
@overload
323-
def peel(self, type: Literal[4] | type[Tag]) -> Tag: ...
327+
def peel(self, type: Literal[4, ObjectType.TAG] | type[Tag]) -> Tag: ...
324328
@overload
325-
def peel(self, type: Literal[3] | type[Blob]) -> Blob: ...
329+
def peel(self, type: Literal[3, ObjectType.BLOB] | type[Blob]) -> Blob: ...
326330
@overload
327-
def peel(self, type: None) -> Commit | Tree | Blob: ...
331+
def peel(self, type: Literal[None, ObjectType.ANY]) -> Commit | Tree | Blob: ...
328332
def rename(self, new_name: str) -> None: ...
329333
def resolve(self) -> Reference: ...
330334
def set_target(self, target: _OidArg, message: str = ...) -> None: ...

0 commit comments

Comments
 (0)