Rollup merge of #89757 - jyn514:submodule, r=Mark-Simulacrum

Use shallow clones for submodules

This reduces the amount of git history downloaded for submodules from ~67M to ~11M. For comparison, a shallow clone of rust-lang/rust is 103M and a deep clone is 740M, so this almost halves the amount of history necessary if you made a shallow clone to start, and it's a significant reduction even if not.

Closes https://github.com/rust-lang/rust/issues/63978. r? `@Mark-Simulacrum`
This commit is contained in:
Matthias Krüger 2021-10-13 22:51:02 +02:00 committed by GitHub
commit 9f0ef184b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1001,7 +1001,7 @@ class RustBuild(object):
run(["git", "submodule", "-q", "sync", module],
cwd=self.rust_root, verbose=self.verbose)
update_args = ["git", "submodule", "update", "--init", "--recursive"]
update_args = ["git", "submodule", "update", "--init", "--recursive", "--depth=1"]
if self.git_version >= distutils.version.LooseVersion("2.11.0"):
update_args.append("--progress")
update_args.append(module)