From f066c7adb5f5773dc1d0dd986c786bc0c5094e31 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Sat, 31 Jul 2021 16:52:42 +0100 Subject: Add type to symbolicreference.is_remote() --- git/refs/symbolic.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'git/refs/symbolic.py') diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index bffcfea5..b072f142 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -526,8 +526,9 @@ class SymbolicReference(object): return ref @classmethod - def create(cls, repo: 'Repo', path: PathLike, reference: Union[Commit_ish, str] = 'HEAD', - logmsg: Union[str, None] = None, force: bool = False, **kwargs: Any): + def create(cls: Type[T_References], repo: 'Repo', path: PathLike, + reference: Union['SymbolicReference', str] = 'HEAD', + logmsg: Union[str, None] = None, force: bool = False, **kwargs: Any) -> T_References: """Create a new symbolic reference, hence a reference pointing , to another reference. :param repo: @@ -689,6 +690,6 @@ class SymbolicReference(object): # END for each type to try raise ValueError("Could not find reference type suitable to handle path %r" % path) - def is_remote(self): + def is_remote(self) -> bool: """:return: True if this symbolic reference points to a remote branch""" - return self.path.startswith(self._remote_common_path_default + "/") + return str(self.path).startswith(self._remote_common_path_default + "/") -- cgit v1.2.1