Fix git checkout with submodules

This commit is contained in:
allegroai 2020-03-12 18:39:47 +02:00
parent 5fb2550212
commit 389600b91e

View File

@ -458,6 +458,16 @@ class Git(VCS):
def pull(self): def pull(self):
self.call("fetch", "--all", "--recurse-submodules", cwd=self.location) self.call("fetch", "--all", "--recurse-submodules", cwd=self.location)
def checkout(self): # type: () -> None
"""
Checkout repository at specified revision
"""
self.call("checkout", self.revision, *self.checkout_flags, cwd=self.location)
try:
self.call("submodule", "update", "--recursive", cwd=self.location)
except:
pass
info_commands = dict( info_commands = dict(
url=Argv(executable_name, "ls-remote", "--get-url", "origin"), url=Argv(executable_name, "ls-remote", "--get-url", "origin"),
branch=Argv(executable_name, "rev-parse", "--abbrev-ref", "HEAD"), branch=Argv(executable_name, "rev-parse", "--abbrev-ref", "HEAD"),