diff options
Diffstat (limited to 'git/refs')
-rw-r--r-- | git/refs/head.py | 2 | ||||
-rw-r--r-- | git/refs/remote.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/git/refs/head.py b/git/refs/head.py index 56a87182..d1d72c7b 100644 --- a/git/refs/head.py +++ b/git/refs/head.py @@ -129,7 +129,7 @@ class Head(Reference): k_config_remote_ref = "merge" # branch to merge from remote @classmethod - def delete(cls, repo: 'Repo', *heads: 'Head', force: bool = False, **kwargs: Any) -> None: + def delete(cls, repo: 'Repo', *heads: 'Union[Head, str]', force: bool = False, **kwargs: Any) -> None: """Delete the given heads :param force: diff --git a/git/refs/remote.py b/git/refs/remote.py index 9b74d87f..1b416bd0 100644 --- a/git/refs/remote.py +++ b/git/refs/remote.py @@ -37,8 +37,13 @@ class RemoteReference(Head): # super is Reference return super(RemoteReference, cls).iter_items(repo, common_path) + # The Head implementation of delete also accepts strs, but this + # 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', **kwargs: Any) -> None: + def delete(cls, repo: 'Repo', *refs: 'RemoteReference', # type: ignore + **kwargs: Any) -> None: """Delete the given remote references :note: |