From e71b32c79c0d6737766898e6ec65d02b604d3270 Mon Sep 17 00:00:00 2001 From: Yaroslav Lobankov Date: Tue, 5 Apr 2022 18:14:39 +0300 Subject: [PATCH] Consider submodules while commit and PR checkout (#7500) This fix includes a few updates for infra/repo_manager.py: * Add step for updating submodules while commit checkout * Add step for updating submodules while PR checkout Fixes #7493 --- infra/repo_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/infra/repo_manager.py b/infra/repo_manager.py index 2d1fea787..8e86f2548 100644 --- a/infra/repo_manager.py +++ b/infra/repo_manager.py @@ -202,6 +202,8 @@ class RepoManager: self.fetch_unshallow() self.git(['fetch', 'origin', pr_ref], check_result=True) self.git(['checkout', '-f', 'FETCH_HEAD'], check_result=True) + self.git(['submodule', 'update', '-f', '--init', '--recursive'], + check_result=True) def checkout_commit(self, commit, clean=True): """Checks out a specific commit from the repo. @@ -217,6 +219,8 @@ class RepoManager: if not self.commit_exists(commit): raise ValueError('Commit %s does not exist in current branch' % commit) self.git(['checkout', '-f', commit], check_result=True) + self.git(['submodule', 'update', '-f', '--init', '--recursive'], + check_result=True) if clean: self.git(['clean', '-fxd'], check_result=True) if self.get_current_commit() != commit: