summaryrefslogtreecommitdiff
path: root/git/remote.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-06 14:06:59 +0100
committerYobmod <yobmod@gmail.com>2021-07-06 14:06:59 +0100
commit3ce319f1296a5402079e9280500e96cc1d12fd04 (patch)
treec1c6f6684fa55c2509750377fcdc15e9dcb1018a /git/remote.py
parenta9351347d704db02bd3d1103e9715ff6a999e3f9 (diff)
downloadgitpython-3ce319f1296a5402079e9280500e96cc1d12fd04.tar.gz
Add types to submodule.update()
Diffstat (limited to 'git/remote.py')
-rw-r--r--git/remote.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/git/remote.py b/git/remote.py
index 0ef54ea7..739424ee 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -42,6 +42,7 @@ from git.types import PathLike, Literal, TBD, TypeGuard, Commit_ish
if TYPE_CHECKING:
from git.repo.base import Repo
+ from git.objects.submodule.base import UpdateProgress
# from git.objects.commit import Commit
# from git.objects import Blob, Tree, TagObject
@@ -64,7 +65,9 @@ __all__ = ('RemoteProgress', 'PushInfo', 'FetchInfo', 'Remote')
#{ Utilities
-def add_progress(kwargs: Any, git: Git, progress: Union[Callable[..., Any], None]) -> Any:
+def add_progress(kwargs: Any, git: Git,
+ progress: Union[RemoteProgress, 'UpdateProgress', Callable[..., RemoteProgress], None]
+ ) -> Any:
"""Add the --progress flag to the given kwargs dict if supported by the
git command. If the actual progress in the given progress instance is not
given, we do not request any progress
@@ -794,7 +797,7 @@ class Remote(LazyMixin, IterableObj):
config.release()
def fetch(self, refspec: Union[str, List[str], None] = None,
- progress: Union[Callable[..., Any], None] = None,
+ progress: Union[RemoteProgress, None, 'UpdateProgress'] = None,
verbose: bool = True, **kwargs: Any) -> IterableList[FetchInfo]:
"""Fetch the latest changes for this remote
@@ -841,7 +844,7 @@ class Remote(LazyMixin, IterableObj):
return res
def pull(self, refspec: Union[str, List[str], None] = None,
- progress: Union[Callable[..., Any], None] = None,
+ progress: Union[RemoteProgress, 'UpdateProgress', None] = None,
**kwargs: Any) -> IterableList[FetchInfo]:
"""Pull changes from the given branch, being the same as a fetch followed
by a merge of branch with your local branch.
@@ -862,7 +865,7 @@ class Remote(LazyMixin, IterableObj):
return res
def push(self, refspec: Union[str, List[str], None] = None,
- progress: Union[Callable[..., Any], None] = None,
+ progress: Union[RemoteProgress, 'UpdateProgress', Callable[..., RemoteProgress], None] = None,
**kwargs: Any) -> IterableList[PushInfo]:
"""Push changes from source branch in refspec to target branch in refspec.