From a0d63354f231ddec9b426f89420464fbaabcf410 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 29 Apr 2019 17:01:42 -0400 Subject: [PATCH] intelligently handle older version of git in bootstrap If we fail to run with `--progress`, try running without instead. Fixes #57080. --- src/bootstrap/bootstrap.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 8af7aa4856c38..86c82adffa9b0 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -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"],