From 65e17a3c3fb5a80b7cc2d5a8230ec47a311311a2 Mon Sep 17 00:00:00 2001 From: KaruroChori Date: Sun, 1 Sep 2024 12:02:53 +0000 Subject: [PATCH 1/2] Update scanner.py Added measures to limit the amount of things downloaded from git. --- scanner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scanner.py b/scanner.py index a58caa85..98d8a4d8 100644 --- a/scanner.py +++ b/scanner.py @@ -259,7 +259,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, multi_options = ["--depth=1", "--single-branch" "--recurse-submodules"]) print(f"Cloning {repo_name}...") except Exception as e: print(f"Cloning {repo_name} failed: {e}") @@ -525,4 +525,4 @@ updated_node_info = update_custom_nodes() print("\n# 'extension-node-map.json' file is generated.\n") gen_json(updated_node_info) -print("\nDONE.\n") \ No newline at end of file +print("\nDONE.\n") From 76811f35fc3290037f4b042fa2dc9c123c81ef64 Mon Sep 17 00:00:00 2001 From: karurochari Date: Sun, 1 Sep 2024 12:24:28 +0000 Subject: [PATCH 2/2] Fixed cloning depth & branch selection --- glob/manager_core.py | 4 ++-- scanner.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index 0e7400bf..2f126878 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -563,11 +563,11 @@ def gitclone_install(files, instant_execution=False, msg_prefix=''): # Clone the repository from the remote URL if not instant_execution and platform.system() == 'Windows': - res = manager_funcs.run_script([sys.executable, git_script_path, "--clone", custom_nodes_path, url], cwd=custom_nodes_path) + res = manager_funcs.run_script([sys.executable, git_script_path, "--clone --depth=1 --single-branch --recurse-submodules", custom_nodes_path, url], cwd=custom_nodes_path) if res != 0: return False else: - repo = git.Repo.clone_from(url, repo_path, recursive=True, progress=GitProgress()) + repo = git.Repo.clone_from(url, repo_path, multi_options = ["--depth=1", "--single-branch", "--recurse-submodules"], progress=GitProgress()) repo.git.clear_cache() repo.close() diff --git a/scanner.py b/scanner.py index 98d8a4d8..e76ddd34 100644 --- a/scanner.py +++ b/scanner.py @@ -259,7 +259,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, multi_options = ["--depth=1", "--single-branch" "--recurse-submodules"]) + Repo.clone_from(git_url, repo_dir, multi_options = ["--depth=1", "--single-branch", "--recurse-submodules"]) print(f"Cloning {repo_name}...") except Exception as e: print(f"Cloning {repo_name} failed: {e}")