feature: agrego soporte para parametros repetidos en llamadas a Git
This commit is contained in:
+4
-1
@@ -89,7 +89,7 @@ class Git:
|
||||
def is_repository() -> bool:
|
||||
return Git("rev-parse", is_inside_work_tree=True).code() == 0
|
||||
|
||||
def __init__(self, subcommand: str, *args: str, **kwargs: str | int | bool | None) -> None:
|
||||
def __init__(self, subcommand: str, *args: str, **kwargs: str | int | bool | list[str] | None) -> None:
|
||||
self.command = ["git", subcommand]
|
||||
|
||||
for option, value in kwargs.items():
|
||||
@@ -103,6 +103,9 @@ class Git:
|
||||
self.command.append(prefix + option)
|
||||
elif value is None:
|
||||
continue
|
||||
elif isinstance(value, list):
|
||||
for v in value:
|
||||
self.command.append("--" + option + "=" + v)
|
||||
else:
|
||||
value = value if isinstance(value, str) else str(value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user