diff --git a/oca_port/migrate_addon.py b/oca_port/migrate_addon.py index fad38a8..7bace9d 100644 --- a/oca_port/migrate_addon.py +++ b/oca_port/migrate_addon.py @@ -178,10 +178,13 @@ def run(self): def _checkout_base_branch(self): # Ensure to not start to work from a working branch if self.app.to_branch.name in self.app.repo.heads: - self.app.repo.heads[self.app.to_branch.name].checkout() + self.app.repo.heads[self.app.to_branch.name].checkout( + "--recurse-submodules", + ) else: self.app.repo.git.checkout( "--no-track", + "--recurse-submodules", "-b", self.app.to_branch.name, self.app.to_branch.ref(), @@ -205,7 +208,11 @@ def _create_mig_branch(self): f"from {self.app.to_branch.ref()}..." ) self.app.repo.git.checkout( - "--no-track", "-b", self.mig_branch.name, self.app.to_branch.ref() + "--no-track", + "--recurse-submodules", + "-b", + self.mig_branch.name, + self.app.to_branch.ref(), ) return create_branch diff --git a/oca_port/port_addon_pr.py b/oca_port/port_addon_pr.py index b0150b3..a9bd0b7 100644 --- a/oca_port/port_addon_pr.py +++ b/oca_port/port_addon_pr.py @@ -181,7 +181,10 @@ def _port_pull_requests(self, branches_diff): if self.app.repo.active_branch.name == dest_branch_name: # We cannot delete an active branch, checkout the underlying # commit instead - self.app.repo.git.checkout(dest_commit) + self.app.repo.git.checkout( + "--recurse-submodules", + dest_commit, + ) self.app.repo.delete_head(dest_branch_name, "-f") dest_branch_exists = False # Clear any ongoing work from the session @@ -189,11 +192,17 @@ def _port_pull_requests(self, branches_diff): session.clear() if not dest_branch_exists: self.app.repo.git.checkout( - "--no-track", "-b", dest_branch_name, base_ref.ref() + "--no-track", + "--recurse-submodules", + "-b", + dest_branch_name, + base_ref.ref(), ) # Checkout the destination branch before porting PRs dest_branch = g.Branch(self.app.repo, dest_branch_name) - self.app.repo.heads[dest_branch.name].checkout() + self.app.repo.heads[dest_branch.name].checkout( + "--recurse-submodules", + ) last_pr = ( list(branches_diff.commits_diff["addon"].keys())[-1] if branches_diff.commits_diff["addon"]