TC Windows: Use generic-worker "raw mounts" for the sparse-checkout file

CC https://bugzilla.mozilla.org/show_bug.cgi?id=1495732
This commit is contained in:
Simon Sapin 2019-02-15 19:31:48 +01:00
parent ddb85a92de
commit c39dbb81e3

View file

@ -431,14 +431,15 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
cd repo cd repo
""" """
if sparse_checkout: if sparse_checkout:
self.with_mounts({
"file": "sparse-checkout",
"content": {"raw": "\n".join(sparse_checkout)},
})
git += """ git += """
git config core.sparsecheckout true git config core.sparsecheckout true
echo %SPARSE_CHECKOUT_BASE64% > .git\\info\\sparse.b64 copy ..\\sparse-checkout .git\\info\\sparse-checkout
certutil -decode .git\\info\\sparse.b64 .git\\info\\sparse-checkout
type .git\\info\\sparse-checkout type .git\\info\\sparse-checkout
""" """
self.env["SPARSE_CHECKOUT_BASE64"] = base64.b64encode(
"\n".join(sparse_checkout).encode("utf-8"))
git += """ git += """
git fetch --depth 1 %GIT_URL% %GIT_REF% git fetch --depth 1 %GIT_URL% %GIT_REF%
git reset --hard %GIT_SHA% git reset --hard %GIT_SHA%