From ef48a3513d7a9456fd57f4da248a9c73f9e668bd Mon Sep 17 00:00:00 2001 From: Yobmod Date: Sat, 31 Jul 2021 18:01:01 +0100 Subject: Add type to refs.head.delete() --- git/refs/head.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'git/refs/head.py') diff --git a/git/refs/head.py b/git/refs/head.py index 260bf5e7..56a87182 100644 --- a/git/refs/head.py +++ b/git/refs/head.py @@ -21,7 +21,7 @@ if TYPE_CHECKING: __all__ = ["HEAD", "Head"] -def strip_quotes(string): +def strip_quotes(string: str) -> str: if string.startswith('"') and string.endswith('"'): return string[1:-1] return string @@ -129,14 +129,13 @@ class Head(Reference): k_config_remote_ref = "merge" # branch to merge from remote @classmethod - def delete(cls, repo: 'Repo', *heads: 'Head', **kwargs: Any): + def delete(cls, repo: 'Repo', *heads: 'Head', force: bool = False, **kwargs: Any) -> None: """Delete the given heads :param force: If True, the heads will be deleted even if they are not yet merged into the main development stream. Default False""" - force = kwargs.get("force", False) flag = "-d" if force: flag = "-D" -- cgit v1.2.1