diff --git a/git_helper.py b/git_helper.py index e79b43a6..7c719667 100644 --- a/git_helper.py +++ b/git_helper.py @@ -71,7 +71,7 @@ def gitclone(custom_nodes_path, url, target_hash=None, repo_path=None): repo_path = os.path.join(custom_nodes_path, repo_name) # Clone the repository from the remote URL - repo = git.Repo.clone_from(url, repo_path, recursive=True, progress=GitProgress()) + repo = git.Repo.clone_from(url, repo_path, recursive=True, progress=GitProgress(), depth=1) if target_hash is not None: print(f"CHECKOUT: {repo_name} [{target_hash}]") diff --git a/glob/manager_core.py b/glob/manager_core.py index 41906a6f..d38050e2 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -1294,7 +1294,7 @@ class UnifiedManager: if res != 0: return result.fail(f"Failed to clone repo: {clone_url}") else: - repo = git.Repo.clone_from(clone_url, repo_path, recursive=True, progress=GitProgress()) + repo = git.Repo.clone_from(clone_url, repo_path, recursive=True, progress=GitProgress(), depth=1) repo.git.clear_cache() repo.close() @@ -2133,7 +2133,7 @@ async def gitclone_install(url, instant_execution=False, msg_prefix='', no_deps= if res != 0: return result.fail(f"Failed to clone '{clone_url}' into '{repo_path}'") else: - repo = git.Repo.clone_from(clone_url, repo_path, recursive=True, progress=GitProgress()) + repo = git.Repo.clone_from(clone_url, repo_path, recursive=True, progress=GitProgress(), depth=1) if commit_id!= "": repo.git.checkout(commit_id) repo.git.submodule('update', '--init', '--recursive') diff --git a/scanner.py b/scanner.py index 0c3d6c44..98288777 100644 --- a/scanner.py +++ b/scanner.py @@ -262,7 +262,7 @@ def clone_or_pull_git_repository(git_url): print(f"Pulling {repo_name} failed: {e}") else: try: - Repo.clone_from(git_url, repo_dir, recursive=True) + Repo.clone_from(git_url, repo_dir, recursive=True, depth=1) print(f"Cloning {repo_name}...") except Exception as e: print(f"Cloning {repo_name} failed: {e}")