Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
LysandreJik committed Oct 28, 2021
1 parent 7790114 commit 6ae35df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/huggingface_hub/repository.py
Expand Up @@ -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)
Expand All @@ -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)

Expand Down

0 comments on commit 6ae35df

Please sign in to comment.