kopia lustrzana https://github.com/jupyterhub/repo2docker
Fix submodule check out
rodzic
0dba6111c6
commit
e4e9c1fdce
|
@ -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(
|
||||
|
|
Ładowanie…
Reference in New Issue