Skip to content

Commit

Permalink
intelligently handle older version of git in bootstrap
Browse files Browse the repository at this point in the history
If we fail to run with `--progress`, try running without instead.

Fixes rust-lang#57080.
  • Loading branch information
froydnj committed Apr 29, 2019
1 parent 00acb7b commit a0d6335
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,15 @@ def update_submodule(self, module, checked_out, recorded_submodules):

run(["git", "submodule", "-q", "sync", module],
cwd=self.rust_root, verbose=self.verbose)
run(["git", "submodule", "update",
"--init", "--recursive", "--progress", module],
cwd=self.rust_root, verbose=self.verbose)
try:
run(["git", "submodule", "update",
"--init", "--recursive", "--progress", module],
cwd=self.rust_root, verbose=self.verbose, exception=True)
except RuntimeError:
# Some versions of git don't support --progress.
run(["git", "submodule", "update",
"--init", "--recursive", module],
cwd=self.rust_root, verbose=self.verbose)
run(["git", "reset", "-q", "--hard"],
cwd=module_path, verbose=self.verbose)
run(["git", "clean", "-qdfx"],
Expand Down

0 comments on commit a0d6335

Please sign in to comment.