Skip to content

Commit 3d64420

Browse files
authored
Rollup merge of #104865 - pratushrai0309:bootstrap, r=jyn514
Don't overwrite local changes when updating submodules Fixes #103485
2 parents 091f5e1 + d742407 commit 3d64420

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bootstrap/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,10 @@ impl Build {
647647
if !update(true).status().map_or(false, |status| status.success()) {
648648
self.run(&mut update(false));
649649
}
650-
650+
self.run(Command::new("git").args(&["stash", "push"]).current_dir(&absolute_path));
651651
self.run(Command::new("git").args(&["reset", "-q", "--hard"]).current_dir(&absolute_path));
652-
self.run(Command::new("git").args(&["clean", "-qdfx"]).current_dir(absolute_path));
652+
self.run(Command::new("git").args(&["clean", "-qdfx"]).current_dir(&absolute_path));
653+
self.run(Command::new("git").args(&["stash", "pop"]).current_dir(absolute_path));
653654
}
654655

655656
/// If any submodule has been initialized already, sync it unconditionally.

0 commit comments

Comments
 (0)