diff options
| author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-05-18 08:17:32 +0800 |
|---|---|---|
| committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-05-18 08:17:32 +0800 |
| commit | 38e9a18b976b2b7e3b3cd0fcd5b037573823d7c2 (patch) | |
| tree | 8ac0bc1540650cf3befff11735e1421de372fa92 /git/refs/remote.py | |
| parent | b30720ee4d9762a03eae4fa7cfa4b0190d81784d (diff) | |
| parent | 43c00af7e542911cce638cfab49c6a6dc9349e55 (diff) | |
| download | gitpython-38e9a18b976b2b7e3b3cd0fcd5b037573823d7c2.tar.gz | |
Merge branch 'black-fmt'
Diffstat (limited to 'git/refs/remote.py')
| -rw-r--r-- | git/refs/remote.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/git/refs/remote.py b/git/refs/remote.py index 1b416bd0..ec10c5a1 100644 --- a/git/refs/remote.py +++ b/git/refs/remote.py @@ -23,12 +23,18 @@ if TYPE_CHECKING: class RemoteReference(Head): """Represents a reference pointing to a remote head.""" + _common_path_default = Head._remote_common_path_default @classmethod - def iter_items(cls, repo: 'Repo', common_path: Union[PathLike, None] = None, - remote: Union['Remote', None] = None, *args: Any, **kwargs: Any - ) -> Iterator['RemoteReference']: + def iter_items( + cls, + repo: "Repo", + common_path: Union[PathLike, None] = None, + remote: Union["Remote", None] = None, + *args: Any, + **kwargs: Any, + ) -> Iterator["RemoteReference"]: """Iterate remote references, and if given, constrain them to the given remote""" common_path = common_path or cls._common_path_default if remote is not None: @@ -41,9 +47,8 @@ class RemoteReference(Head): # implementation does not. mypy doesn't have a way of representing # tightening the types of arguments in subclasses and recommends Any or # "type: ignore". (See https://github.com/python/typing/issues/241) - @ classmethod - def delete(cls, repo: 'Repo', *refs: 'RemoteReference', # type: ignore - **kwargs: Any) -> None: + @classmethod + def delete(cls, repo: "Repo", *refs: "RemoteReference", **kwargs: Any) -> None: # type: ignore """Delete the given remote references :note: @@ -64,7 +69,7 @@ class RemoteReference(Head): pass # END for each ref - @ classmethod + @classmethod def create(cls, *args: Any, **kwargs: Any) -> NoReturn: """Used to disable this method""" raise TypeError("Cannot explicitly create remote references") |
