Skip to content

Commit

Permalink
Rollup merge of #89757 - jyn514:submodule, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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 #63978. r? `@Mark-Simulacrum`
  • Loading branch information
matthiaskrgr authored Oct 13, 2021
2 parents 06110c0 + 9177fa3 commit 9f0ef18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ def update_submodule(self, module, checked_out, recorded_submodules):
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)
Expand Down

0 comments on commit 9f0ef18

Please sign in to comment.