Fix submodule check out

pull/809/head
David Brochart 2019-11-05 15:10:19 +01:00
rodzic 0dba6111c6
commit e4e9c1fdce
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -23,7 +23,12 @@ class Git(ContentProvider):
try:
cmd = ["git", "clone", "--recursive"]
if ref is None:
# check out of HEAD is performed after the clone is complete
cmd.extend(["--depth", "1"])
else:
# don't check out HEAD, the given ref will be checked out later
# this prevents HEAD's submodules to be cloned if ref doesn't have them
cmd.extend(["--no-checkout"])
cmd.extend([repo, output_dir])
for line in execute_cmd(cmd, capture=yield_output):
yield line
@ -34,6 +39,11 @@ class Git(ContentProvider):
# check out the specific ref given by the user
if ref is not None:
# check out ref as it has not been done yet
for line in execute_cmd(
["git", "checkout", ref], cwd=output_dir, capture=yield_output
):
yield line
hash = check_ref(ref, output_dir)
if hash is None:
self.log.error(