Fix submodule update (#2434)

This commit is contained in:
Pascal Vizeli 2021-01-15 14:28:31 +01:00 committed by GitHub
parent 560e04c64a
commit e1068997ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,10 @@ class GitRepo(CoreSysAttributes):
self.data: Dict[str, str] = RE_REPOSITORY.match(url).groupdict()
def __repr__(self) -> str:
"""Return internal representation."""
return f"<Git: {self.path!s}>"
@property
def url(self) -> str:
"""Return repository URL."""
@ -160,15 +164,13 @@ class GitRepo(CoreSysAttributes):
)
# Update submodules
if len(self.repo.submodules) > 0:
for submodule in self.repo.submodules:
await self.sys_run_in_executor(
ft.partial(
self.repo.git.submodule.root.update,
submodule.update,
**{
"recursive": False,
"init": True,
"force_remove": True,
"force_reset": True,
},
)
)