From 01c9a5f096c0723058141892e10cd950d070f1c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:01:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- southwark/__init__.py | 4 ++-- southwark/config.py | 4 ++-- southwark/log.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/southwark/__init__.py b/southwark/__init__.py index d410ac9..58bfb9e 100644 --- a/southwark/__init__.py +++ b/southwark/__init__.py @@ -417,13 +417,13 @@ def clone( target_config = r.get_config() target_config.set(("remote", origin), "url", source.encode("UTF-8")) - target_config.set(("remote", origin), "fetch", f"+refs/heads/*:refs/remotes/{origin}/*".encode("UTF-8")) + target_config.set(("remote", origin), "fetch", f"+refs/heads/*:refs/remotes/{origin}/*".encode()) target_config.write_to_path() fetch_result = fetch( r, origin, errstream=errstream, - message=f"clone: from {source}".encode("UTF-8"), + message=f"clone: from {source}".encode(), depth=depth, **kwargs, ) diff --git a/southwark/config.py b/southwark/config.py index d020553..65617f0 100644 --- a/southwark/config.py +++ b/southwark/config.py @@ -62,7 +62,7 @@ def set_remote_ssh(config: ConfigFile, domain: str, username: str, repo: str, na :param name: The name of the remote to set. """ - config.set(("remote", name), "url", f"git@{domain}:{username}/{repo}.git".encode("UTF-8")) + config.set(("remote", name), "url", f"git@{domain}:{username}/{repo}.git".encode()) def set_remote_http(config: ConfigFile, domain: str, username: str, repo: str, name: str = "origin") -> None: @@ -76,7 +76,7 @@ def set_remote_http(config: ConfigFile, domain: str, username: str, repo: str, n :param name: The name of the remote to set. """ - config.set(("remote", name), "url", f"https://{domain}/{username}/{repo}.git".encode("UTF-8")) + config.set(("remote", name), "url", f"https://{domain}/{username}/{repo}.git".encode()) set_remote_html = set_remote_http diff --git a/southwark/log.py b/southwark/log.py index 9495b83..223218b 100644 --- a/southwark/log.py +++ b/southwark/log.py @@ -74,8 +74,7 @@ def __init__(self, repo: Union[dulwich.repo.Repo, PathLike] = '.'): #: Mapping of git refs to commit SHAs. self.refs: Dict[str, str] = { k.decode("UTF-8"): v.decode("UTF-8") - for k, - v in self.repo.get_refs().items() + for k, v in self.repo.get_refs().items() if not k.startswith(b"refs/tags/") }