Skip to content

Commit

Permalink
Rollup merge of rust-lang#104865 - pratushrai0309:bootstrap, r=jyn514
Browse files Browse the repository at this point in the history
Don't overwrite local changes when updating submodules

Fixes rust-lang#103485
  • Loading branch information
matthiaskrgr authored Nov 30, 2022
2 parents ddd980a + d742407 commit 32f5bd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,10 @@ impl Build {
if !update(true).status().map_or(false, |status| status.success()) {
self.run(&mut update(false));
}

self.run(Command::new("git").args(&["stash", "push"]).current_dir(&absolute_path));
self.run(Command::new("git").args(&["reset", "-q", "--hard"]).current_dir(&absolute_path));
self.run(Command::new("git").args(&["clean", "-qdfx"]).current_dir(absolute_path));
self.run(Command::new("git").args(&["clean", "-qdfx"]).current_dir(&absolute_path));
self.run(Command::new("git").args(&["stash", "pop"]).current_dir(absolute_path));
}

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

0 comments on commit 32f5bd9

Please sign in to comment.