Skip to content

Commit

Permalink
Fix git checkout with submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
allegroai committed Mar 12, 2020
1 parent 5fb2550 commit 389600b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions trains_agent/helper/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,16 @@ def executable_not_found_error_help(self):
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"),
Expand Down

0 comments on commit 389600b

Please sign in to comment.