Skip to content

Commit 1769a42

Browse files
authored
Rollup merge of #64278 - guanqun:check-git, r=Mark-Simulacrum
check git in bootstrap.py
2 parents 7e98ec5 + b117bd7 commit 1769a42

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bootstrap/bootstrap.py

+8
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,14 @@ def update_submodules(self):
708708
if (not os.path.exists(os.path.join(self.rust_root, ".git"))) or \
709709
self.get_toml('submodules') == "false":
710710
return
711+
712+
# check the existence of 'git' command
713+
try:
714+
subprocess.check_output(['git', '--version'])
715+
except (subprocess.CalledProcessError, OSError):
716+
print("error: `git` is not found, please make sure it's installed and in the path.")
717+
sys.exit(1)
718+
711719
slow_submodules = self.get_toml('fast-submodules') == "false"
712720
start_time = time()
713721
if slow_submodules:

0 commit comments

Comments
 (0)