Remove support for shallow clones. The bundle is already shallow.

This commit is contained in:
Simon Sapin 2019-11-22 15:36:54 +01:00
parent 3a8bb531a0
commit 4dbdd255a1
2 changed files with 7 additions and 9 deletions

View file

@ -595,7 +595,7 @@ def update_wpt():
.with_index_and_artifacts_expire_in(log_artifacts_expire_in) .with_index_and_artifacts_expire_in(log_artifacts_expire_in)
.with_max_run_time_minutes(6 * 60) .with_max_run_time_minutes(6 * 60)
# Not using the bundle, pushing the new changes to the git remote requires a full repo. # Not using the bundle, pushing the new changes to the git remote requires a full repo.
.with_repo(shallow=False, alternate_object_dir="/var/cache/servo.git/objects") .with_repo(alternate_object_dir="/var/cache/servo.git/objects")
) )
return ( return (
with_homebrew(update_task, [ with_homebrew(update_task, [

View file

@ -487,9 +487,9 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
self.with_early_script("set PATH=%HOMEDRIVE%%HOMEPATH%\\{};%PATH%".format(p)) self.with_early_script("set PATH=%HOMEDRIVE%%HOMEPATH%\\{};%PATH%".format(p))
return self return self
def with_repo(self, sparse_checkout=None, shallow=True): def with_repo(self, sparse_checkout=None):
""" """
Make a shallow clone the git repository at the start of the task. Make a clone the git repository at the start of the task.
This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`, This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`,
and creates the clone in a `repo` directory in the tasks home directory. and creates the clone in a `repo` directory in the tasks home directory.
@ -512,13 +512,12 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
type .git\\info\\sparse-checkout type .git\\info\\sparse-checkout
""" """
git += """ git += """
git fetch --no-tags {depth} {} {} git fetch --no-tags {} {}
git reset --hard {} git reset --hard {}
""".format( """.format(
assert_truthy(self.git_fetch_url), assert_truthy(self.git_fetch_url),
assert_truthy(self.git_fetch_ref), assert_truthy(self.git_fetch_ref),
assert_truthy(self.git_checkout_sha), assert_truthy(self.git_checkout_sha),
depth="--depth 30" if shallow else "",
) )
return self \ return self \
.with_git() \ .with_git() \
@ -629,9 +628,9 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
class UnixTaskMixin(Task): class UnixTaskMixin(Task):
def with_repo(self, shallow=True, alternate_object_dir=""): def with_repo(self, alternate_object_dir=""):
""" """
Make a shallow clone the git repository at the start of the task. Make a clone the git repository at the start of the task.
This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha` This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`
* generic-worker: creates the clone in a `repo` directory * generic-worker: creates the clone in a `repo` directory
@ -649,13 +648,12 @@ class UnixTaskMixin(Task):
git init repo git init repo
cd repo cd repo
echo "{alternate}" > .git/objects/info/alternates echo "{alternate}" > .git/objects/info/alternates
time git fetch --no-tags {depth} {} {} time git fetch --no-tags {} {}
time git reset --hard {} time git reset --hard {}
""".format( """.format(
assert_truthy(self.git_fetch_url), assert_truthy(self.git_fetch_url),
assert_truthy(self.git_fetch_ref), assert_truthy(self.git_fetch_ref),
assert_truthy(self.git_checkout_sha), assert_truthy(self.git_checkout_sha),
depth="--depth 30" if shallow else "",
alternate=alternate_object_dir, alternate=alternate_object_dir,
)) ))