Prevent unnecessary submodule fetches

Signed-off-by: Bence Szépkúti <[email protected]>
This commit is contained in:
Bence Szépkúti
2025-09-26 20:27:57 +02:00
parent 8d95062aeb
commit 0f2a4f3d1f
+13
View File
@@ -204,6 +204,19 @@ class AbiChecker:
stderr=subprocess.STDOUT stderr=subprocess.STDOUT
) )
self.log.debug(submodule_output.decode("utf-8")) self.log.debug(submodule_output.decode("utf-8"))
try:
# Try to update the submodules using local commits
# (Git will sometimes insist on fetching the remote without --no-fetch if the submodules are shallow clones)
update_output = subprocess.check_output(
[self.git_command, "submodule", "update", "--init", '--recursive', '--no-fetch'],
cwd=git_worktree_path,
stderr=subprocess.STDOUT
)
except subprocess.CalledProcessError as err:
self.log.debug(err.stdout.decode("utf-8"))
# Checkout with --no-fetch failed, falling back to fetching from origin
update_output = subprocess.check_output( update_output = subprocess.check_output(
[self.git_command, "submodule", "update", "--init", '--recursive'], [self.git_command, "submodule", "update", "--init", '--recursive'],
cwd=git_worktree_path, cwd=git_worktree_path,