From 3e9de0c2108127ca8db8ef28b9a12388d721e08e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 12 Jan 2021 13:53:04 +0100 Subject: [PATCH] Fix submodules - check if it is needed or not (#2426) --- supervisor/store/git.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/supervisor/store/git.py b/supervisor/store/git.py index 58718fd81..4742c398e 100644 --- a/supervisor/store/git.py +++ b/supervisor/store/git.py @@ -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"))