Compare commits

...

3 Commits

Author SHA1 Message Date
Aleksei Sviridkin
fee3718d93 Merge d5119bc264 into 70055e891e 2025-02-20 02:56:24 +03:00
Aleksei Sviridkin
d5119bc264 fix(git_utils): add a newline for better readability in git_cmd_clone
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-02-20 02:56:17 +03:00
Aleksei Sviridkin
8cb66071ac feat(git_utils): enhance git_cmd_clone with depth and single-branch options
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-02-20 02:52:23 +03:00

View File

@@ -253,9 +253,15 @@ def get_remote_commit(repo: Path) -> str | None:
return None
def git_cmd_clone(repo: str, target_dir: Path) -> None:
def git_cmd_clone(repo: str, target_dir: Path, depth: int = 1) -> None:
try:
command = ["git", "clone", repo, target_dir.as_posix()]
command = [
"git", "clone",
"--depth", str(depth),
"--single-branch",
repo,
target_dir.as_posix()
]
run(command, check=True)
Logger.print_ok("Clone successful!")