Commits

Michał Górny  committed 43e4493

[git-2] Restore git submodule support.

  • Participants
  • Parent commits 0ae8d17

Comments (0)

Files changed (1)

File SmartLiveRebuild/vcs/git_2.py

 		VCSSupport.__init__(self, *args)
 		if self.env['EGIT_COMMIT'] and self.env['EGIT_COMMIT'] != self.env['EGIT_BRANCH']:
 			raise NonLiveEbuild('EGIT_COMMIT set, package is not really a live one')
-		# XXX: EGIT_HAS_SUBMODULES requires no EVCS_OFFLINE
 
 	def getpath(self):
 		return self.env['EGIT_DIR']
 				self.env['EGIT_BRANCH']]).split()[0]
 
 	def getupdatecmd(self):
-		return self.env['EGIT_UPDATE_CMD']
+		upcmd = self.env['EGIT_UPDATE_CMD']
+		if self.env['EGIT_HAS_SUBMODULES']:
+			submcmds = ['git submodule %s' % x for x in ('init', 'sync', 'update')]
+			upcmd = ' && '.join([upcmd] + submcmds)
+		return upcmd
 
 	def diffstat(self, oldrev, newrev):
 		subprocess.Popen('%s %s..%s' % ('git --no-pager diff --stat', oldrev, newrev), stdout=sys.stderr, shell=True).wait()