Adding depth 1 to all git installsg

This commit is contained in:
Milad M 2025-05-13 14:29:59 -07:00
parent fc943172eb
commit 49085ea07b
3 changed files with 4 additions and 4 deletions

View File

@ -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) repo_path = os.path.join(custom_nodes_path, repo_name)
# Clone the repository from the remote URL # 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: if target_hash is not None:
print(f"CHECKOUT: {repo_name} [{target_hash}]") print(f"CHECKOUT: {repo_name} [{target_hash}]")

View File

@ -1294,7 +1294,7 @@ class UnifiedManager:
if res != 0: if res != 0:
return result.fail(f"Failed to clone repo: {clone_url}") return result.fail(f"Failed to clone repo: {clone_url}")
else: 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.git.clear_cache()
repo.close() repo.close()
@ -2133,7 +2133,7 @@ async def gitclone_install(url, instant_execution=False, msg_prefix='', no_deps=
if res != 0: if res != 0:
return result.fail(f"Failed to clone '{clone_url}' into '{repo_path}'") return result.fail(f"Failed to clone '{clone_url}' into '{repo_path}'")
else: 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!= "": if commit_id!= "":
repo.git.checkout(commit_id) repo.git.checkout(commit_id)
repo.git.submodule('update', '--init', '--recursive') repo.git.submodule('update', '--init', '--recursive')

View File

@ -262,7 +262,7 @@ def clone_or_pull_git_repository(git_url):
print(f"Pulling {repo_name} failed: {e}") print(f"Pulling {repo_name} failed: {e}")
else: else:
try: 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}...") print(f"Cloning {repo_name}...")
except Exception as e: except Exception as e:
print(f"Cloning {repo_name} failed: {e}") print(f"Cloning {repo_name} failed: {e}")