Fix submodules - check if it is needed or not (#2426)

This commit is contained in:
Pascal Vizeli 2021-01-12 13:53:04 +01:00 committed by GitHub
parent 01a6e074a5
commit 3e9de0c210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,17 +160,18 @@ class GitRepo(CoreSysAttributes):
) )
# Update submodules # Update submodules
await self.sys_run_in_executor( if len(self.repo.submodules) > 0:
ft.partial( await self.sys_run_in_executor(
self.repo.git.submodule.root.update, ft.partial(
**{ self.repo.git.submodule.root.update,
"recursive": False, **{
"init": True, "recursive": False,
"force_remove": True, "init": True,
"force_reset": True, "force_remove": True,
}, "force_reset": True,
},
)
) )
)
# Cleanup old data # Cleanup old data
await self.sys_run_in_executor(ft.partial(self.repo.git.clean, "-xdf")) await self.sys_run_in_executor(ft.partial(self.repo.git.clean, "-xdf"))