diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-31 16:52:42 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-31 16:52:42 +0100 |
commit | f066c7adb5f5773dc1d0dd986c786bc0c5094e31 (patch) | |
tree | a544b298801669a2feff2a1e3ae82a9253c0e4fb | |
parent | 8eedc9d002da9bb085be4a82ffb5372f8f8ff7a2 (diff) | |
download | gitpython-f066c7adb5f5773dc1d0dd986c786bc0c5094e31.tar.gz |
Add type to symbolicreference.is_remote()
-rw-r--r-- | git/refs/symbolic.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 + "/") |