CachedRepository: option to not update submodules
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 4 Apr 2013 08:40:22 +0000 (11:40 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 5 Apr 2013 08:31:41 +0000 (11:31 +0300)
Change-Id: Ifbc603e1355da46a2eb1c0e21e5db1ac0897d885
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
obs_service_gbp/__init__.py

index 5d92216e23e90faaa4765fe474f60b4638b66e9c..396b2f815e71fd5736678ac2b1de104d22252a56 100644 (file)
@@ -161,7 +161,7 @@ class CachedRepo(object):
     def __del__(self):
         self._release_lock()
 
-    def update_working_copy(self, commitish='HEAD'):
+    def update_working_copy(self, commitish='HEAD', submodules=True):
         """Reset HEAD to the given commit-ish"""
         if self.repo.bare:
             raise CachedRepoError('Cannot update working copy of a bare repo')
@@ -178,6 +178,7 @@ class CachedRepo(object):
         except GitRepositoryError as err:
             raise CachedRepoError("Unknown ref '%s': %s" % (commitish, err))
         self.repo.force_head(sha, hard=True)
-        self.repo.update_submodules(init=True, recursive=True, fetch=True)
+        if submodules:
+            self.repo.update_submodules(init=True, recursive=True, fetch=True)
         return sha