Skip to content

Commit 775bb30

Browse files
LuisHenriLee-W
authored andcommitted
fix(commitizen-git): add quotes for tag message
1 parent e2a5ed1 commit 775bb30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

commitizen/git.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@ def from_line(cls, line: str, inner_delimiter: str) -> GitTag:
8282
return cls(name=name, rev=obj, date=date)
8383

8484

85-
def tag(tag: str, annotated: bool = False, signed: bool = False, msg: Optional[str] = None) -> cmd.Command:
85+
def tag(
86+
tag: str, annotated: bool = False, signed: bool = False, msg: Optional[str] = None
87+
) -> cmd.Command:
8688
_opt = ""
8789
if annotated:
8890
_opt = f"-a {tag} -m"
8991
if signed:
9092
_opt = f"-s {tag} -m"
9193

92-
c = cmd.run(f"git tag {_opt} {tag if _opt == '' or msg is None else msg}")
94+
c = cmd.run(f'git tag {_opt} "{tag if _opt == "" or msg is None else msg}"')
9395
return c
9496

9597

0 commit comments

Comments
 (0)