Closed
Description
If x.py
can't check out the right commit of a submodule because the submodule has local edits that would be overwritten by the checkout, it crashes:
Updating only changed submodules
Updating submodule src/tools/rls
error: Your local changes to the following files would be overwritten by checkout:
.dependabot/config.yml
Please commit your changes or stash them before you switch branches.
Aborting
Unable to checkout '2cf84baa5e3c55ac02f42919e67440acb5417125' in submodule path 'src/tools/rls'
Traceback (most recent call last):
File "./x.py", line 11, in <module>
bootstrap.main()
File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 1094, in main
bootstrap(help_triggered)
File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 1060, in bootstrap
build.update_submodules()
File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 924, in update_submodules
self.update_submodule(module[0], module[1], recorded_submodules)
File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 866, in update_submodule
run(update_args, cwd=self.rust_root, verbose=self.verbose, exception=True)
File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 153, in run
raise RuntimeError(err)
RuntimeError: failed to run: git submodule update --init --recursive --progress src/tools/rls
Perhaps this could be handled more gracefully (with some hints on how to revert the changes to the submodule, perhaps?)