Skip to content

Commit 7fbdc1d

Browse files
committed
fix typing in pygit2/__init__.py
1 parent 4503f5a commit 7fbdc1d

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

pygit2/_pygit2.pyi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,24 @@ class Branch(Reference):
379379
def is_head(self) -> bool: ...
380380
def rename(self, name: str, force: bool = False) -> 'Branch': ... # type: ignore[override]
381381

382+
class FetchOptions:
383+
# incomplete
384+
depth: int
385+
proxy_opts: ProxyOpts
386+
387+
class CloneOptions:
388+
# incomplete
389+
version: int
390+
checkout_opts: object
391+
fetch_opts: FetchOptions
392+
bare: int
393+
local: object
394+
checkout_branch: object
395+
repository_cb: object
396+
repository_cb_payload: object
397+
remote_cb: object
398+
remote_cb_payload: object
399+
382400
class Commit(Object):
383401
author: Signature
384402
commit_time: int
@@ -904,5 +922,6 @@ def init_file_backend(path: str, flags: int = 0) -> object: ...
904922
def option(opt: Option, *args) -> None: ...
905923
def reference_is_valid_name(refname: str) -> bool: ...
906924
def tree_entry_cmp(a: Object, b: Object) -> int: ...
925+
def _cache_enums() -> None: ...
907926

908927
_OidArg = str | Oid

pygit2/callbacks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,18 @@
7979

8080
if TYPE_CHECKING:
8181
from .remotes import TransferProgress
82-
from ._pygit2 import ProxyOpts, PushOptions
82+
from ._pygit2 import ProxyOpts, PushOptions, CloneOptions
8383
#
8484
# The payload is the way to pass information from the pygit2 API, through
8585
# libgit2, to the Python callbacks. And back.
8686
#
8787

8888

8989
class Payload:
90+
repository: Callable | None
91+
remote: Callable | None
92+
clone_options: 'CloneOptions'
93+
9094
def __init__(self, **kw: object) -> None:
9195
for key, value in kw.items():
9296
setattr(self, key, value)

0 commit comments

Comments
 (0)