Fetch the remote crypto branch, rather than cloning it

This commit is contained in:
Darryl Green 2019-03-08 11:12:19 +00:00
parent 3a5f6c83bc
commit 1d95c539e9

View File

@ -151,21 +151,23 @@ class AbiChecker(object):
return
if version.crypto_repository:
shutil.rmtree(os.path.join(git_worktree_path, "crypto"))
clone_process = subprocess.Popen(
[self.git_command, "clone", version.crypto_repository,
"--branch", version.crypto_revision, "crypto"],
cwd=git_worktree_path,
fetch_process = subprocess.Popen(
[self.git_command, "fetch", version.crypto_repository,
version.crypto_revision],
cwd=os.path.join(git_worktree_path, "crypto"),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
clone_output, _ = clone_process.communicate()
self.log.info(clone_output.decode("utf-8"))
if clone_process.returncode != 0:
raise Exception("git clone failed, aborting")
fetch_output, _ = fetch_process.communicate()
self.log.info(fetch_output.decode("utf-8"))
if fetch_process.returncode != 0:
raise Exception("git fetch failed, aborting")
crypto_rev = "FETCH_HEAD"
else:
crypto_rev = version.crypto_revision
checkout_process = subprocess.Popen(
[self.git_command, "checkout", version.crypto_revision],
[self.git_command, "checkout", crypto_rev],
cwd=os.path.join(git_worktree_path, "crypto"),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT