From 6ae35df318c046cf075e24f76208e1c6f6ee3980 Mon Sep 17 00:00:00 2001 From: Lysandre Debut Date: Thu, 28 Oct 2021 15:08:06 -0400 Subject: [PATCH] Tweaks --- src/huggingface_hub/repository.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/huggingface_hub/repository.py b/src/huggingface_hub/repository.py index 5519960141..2467254b9d 100644 --- a/src/huggingface_hub/repository.py +++ b/src/huggingface_hub/repository.py @@ -921,7 +921,7 @@ def delete_tag(self, tag_name: str, remote: Optional[str] = None) -> bool: if delete_locally: try: run_subprocess( - f"git tag -d {tag_name}".split(), self.local_dir + ["git", "tag", "-d", tag_name], self.local_dir ).stdout.strip() except subprocess.CalledProcessError as exc: raise EnvironmentError(exc.stderr) @@ -946,12 +946,12 @@ def add_tag(self, tag_name: str, message: str = None, remote: Optional[str] = No if a message is provided, the tag will be annotated. """ if message: - tag_args = f"git tag -a {tag_name} -m {message}" + tag_args = ["git", "tag", "-a", tag_name, "-m", message] else: - tag_args = f"git tag {tag_name}" + tag_args = ["git", "tag", tag_name] try: - run_subprocess(tag_args.split(), self.local_dir).stdout.strip() + run_subprocess(tag_args, self.local_dir).stdout.strip() except subprocess.CalledProcessError as exc: raise EnvironmentError(exc.stderr)