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
await self.sys_run_in_executor(
ft.partial(
self.repo.git.submodule.root.update,
**{
"recursive": False,
"init": True,
"force_remove": True,
"force_reset": True,
},
if len(self.repo.submodules) > 0:
await self.sys_run_in_executor(
ft.partial(
self.repo.git.submodule.root.update,
**{
"recursive": False,
"init": True,
"force_remove": True,
"force_reset": True,
},
)
)
)
# Cleanup old data
await self.sys_run_in_executor(ft.partial(self.repo.git.clean, "-xdf"))