summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/gitsm.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/gitsm.py')
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index a95584c821..0aff1008e5 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -117,14 +117,19 @@ class GitSM(Git):
117 def download(self, ud, d): 117 def download(self, ud, d):
118 Git.download(self, ud, d) 118 Git.download(self, ud, d)
119 119
120 submodules = self.uses_submodules(ud, d, ud.clonedir) 120 if not ud.shallow or ud.localpath != ud.fullshallow:
121 if submodules: 121 submodules = self.uses_submodules(ud, d, ud.clonedir)
122 self.update_submodules(ud, d) 122 if submodules:
123 self.update_submodules(ud, d)
124
125 def clone_shallow_local(self, ud, dest, d):
126 super(GitSM, self).clone_shallow_local(ud, dest, d)
127
128 runfetchcmd('cp -fpPRH "%s/modules" "%s/"' % (ud.clonedir, os.path.join(dest, '.git')), d)
123 129
124 def unpack(self, ud, destdir, d): 130 def unpack(self, ud, destdir, d):
125 Git.unpack(self, ud, destdir, d) 131 Git.unpack(self, ud, destdir, d)
126 132
127 submodules = self.uses_submodules(ud, d, ud.destdir) 133 if self.uses_submodules(ud, d, ud.destdir):
128 if submodules:
129 runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir) 134 runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)
130 runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir) 135 runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)