mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-10-20 21:50:48 +08:00
Use worktrees instead of fetches for submodules
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
This commit is contained in:
@@ -197,6 +197,13 @@ class AbiChecker:
|
|||||||
"""If the crypto submodule is present, initialize it.
|
"""If the crypto submodule is present, initialize it.
|
||||||
if version.crypto_revision exists, update it to that revision,
|
if version.crypto_revision exists, update it to that revision,
|
||||||
otherwise update it to the default 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(
|
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,
|
||||||
@@ -390,6 +397,12 @@ class AbiChecker:
|
|||||||
def _cleanup_worktree(self, git_worktree_path):
|
def _cleanup_worktree(self, git_worktree_path):
|
||||||
"""Remove the specified git worktree."""
|
"""Remove the specified git worktree."""
|
||||||
shutil.rmtree(git_worktree_path)
|
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(
|
worktree_output = subprocess.check_output(
|
||||||
[self.git_command, "worktree", "prune"],
|
[self.git_command, "worktree", "prune"],
|
||||||
cwd=self.repo_path,
|
cwd=self.repo_path,
|
||||||
|
Reference in New Issue
Block a user