Skip to contentSkip to conversation

bitbake: fetch2/gitsm: Fix fetch when the repository contains nested submodules

PATCH New Derek Straka 1 participant 1 message Mar 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake: fetch2/gitsm: Fix fetch when the repository contains nested submodules

This fixes a problem when the repository contains multiple levels of submodules via a resursive submodule init.

---
 bitbake/lib/bb/fetch2/gitsm.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
bitbake/lib/bb/fetch2/gitsm.py +2 -5
index 2ecea7c..752f1d3 100644
@@ -110,8 +110,7 @@ class GitSM(Git):
         os.chdir(tmpclonedir)
         runfetchcmd(ud.basecmd + " reset --hard", d)
         runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d)
-        runfetchcmd(ud.basecmd + " submodule init", d)
-        runfetchcmd(ud.basecmd + " submodule update", d)
+        runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
         self._set_relative_paths(tmpclonedir)
         runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d)
         os.rename(gitdir, ud.clonedir,)
@@ -132,6 +131,4 @@ class GitSM(Git):
         submodules = self.uses_submodules(ud, d)
         if submodules:
             runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d)
-            runfetchcmd(ud.basecmd + " submodule init", d)
-            runfetchcmd(ud.basecmd + " submodule update", d)
-
+            runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
Signature · 1 line
1.9.1