Compare commits

...

9 Commits

Author SHA1 Message Date
Aleksei Sviridkin
7b69adfe7d Merge 7e4ba0d8cd into 8f436646cd 2025-03-10 20:42:55 +01:00
Aleksei Sviridkin
7e4ba0d8cd fix(git_utils): rename blolbless parameter to blobless and update documentation for clarity
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-03-10 22:42:42 +03:00
Aleksei Sviridkin
66c0757be1 fix(git_utils): correct indentation for improved readability in get_local_tags function
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-03-10 16:34:51 +03:00
Aleksei Sviridkin
3a2574f24e fix another formatting changes
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-03-10 16:33:53 +03:00
Aleksei Sviridkin
acb4d0398f revert formatting changes
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-03-10 16:31:23 +03:00
Aleksei Sviridkin
0a08c4fb3f feat(git_utils): update git_cmd_clone to support blolbless cloning option
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-03-10 16:27:37 +03:00
Aleksei Sviridkin
2d4c952b4b feat(git_utils): enhance git_cmd_clone with optional depth and single-branch parameters
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2025-02-21 07:36:49 +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

@@ -255,11 +255,23 @@ def get_remote_commit(repo: Path) -> str | None:
return None return None
def git_cmd_clone(repo: str, target_dir: Path) -> None: def git_cmd_clone(repo: str, target_dir: Path, blobless: bool = False) -> None:
try: """
command = ["git", "clone", repo, target_dir.as_posix()] Clones a repository with optional blobless clone.
run(command, check=True)
:param repo: URL of the repository to clone.
:param target_dir: Path where the repository will be cloned.
:param blobless: If True, perform a blobless clone by adding the '--filter=blob:none' flag.
"""
try:
command = ["git", "clone"]
if blobless:
command.append("--filter=blob:none")
command += [repo, target_dir.as_posix()]
run(command, check=True)
Logger.print_ok("Clone successful!") Logger.print_ok("Clone successful!")
except CalledProcessError as e: except CalledProcessError as e:
error = e.stderr.decode() if e.stderr else "Unknown error" error = e.stderr.decode() if e.stderr else "Unknown error"