From 389600b91e4301997cb895dbde76aeb8d14a3d75 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 12 Mar 2020 18:39:47 +0200 Subject: [PATCH] Fix git checkout with submodules --- trains_agent/helper/repo.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/trains_agent/helper/repo.py b/trains_agent/helper/repo.py index baa4f41..baccfcd 100644 --- a/trains_agent/helper/repo.py +++ b/trains_agent/helper/repo.py @@ -458,6 +458,16 @@ class Git(VCS): def pull(self): 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( url=Argv(executable_name, "ls-remote", "--get-url", "origin"), branch=Argv(executable_name, "rev-parse", "--abbrev-ref", "HEAD"),