From effa534e710772a612d04e5be4a6fe8f47f539d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Sz=C3=A9pk=C3=BAti?= Date: Thu, 25 Sep 2025 15:51:07 +0200 Subject: [PATCH] Use worktrees instead of fetches for submodules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bence Szépkúti --- scripts/abi_check.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/abi_check.py b/scripts/abi_check.py index 243e6fc482..f2a7819048 100755 --- a/scripts/abi_check.py +++ b/scripts/abi_check.py @@ -197,6 +197,13 @@ class AbiChecker: """If the crypto submodule is present, initialize it. if version.crypto_revision exists, update it to that revision, otherwise update it to the default revision""" + submodule_output = subprocess.check_output( + [self.git_command, "submodule", "foreach", "--recursive", + 'git worktree add --detach "{}/$displaypath" HEAD'.format(git_worktree_path)], + cwd=self.repo_path, + stderr=subprocess.STDOUT + ) + self.log.debug(submodule_output.decode("utf-8")) update_output = subprocess.check_output( [self.git_command, "submodule", "update", "--init", '--recursive'], cwd=git_worktree_path, @@ -390,6 +397,12 @@ class AbiChecker: def _cleanup_worktree(self, git_worktree_path): """Remove the specified git worktree.""" shutil.rmtree(git_worktree_path) + submodule_output = subprocess.check_output( + [self.git_command, "submodule", "foreach", "--recursive", "git worktree prune"], + cwd=self.repo_path, + stderr=subprocess.STDOUT + ) + self.log.debug(submodule_output.decode("utf-8")) worktree_output = subprocess.check_output( [self.git_command, "worktree", "prune"], cwd=self.repo_path,