Skip to content

Commit e11e640

Browse files
committed
replace all instances of check_run in config with execution context
1 parent 64033a4 commit e11e640

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,12 +1373,13 @@ impl Config {
13731373
}
13741374

13751375
println!("Updating submodule {relative_path}");
1376-
self.check_run(
1377-
helpers::git(Some(&self.src))
1378-
.run_always()
1379-
.args(["submodule", "-q", "sync"])
1380-
.arg(relative_path),
1381-
);
1376+
1377+
helpers::git(Some(&self.src))
1378+
.allow_failure()
1379+
.run_always()
1380+
.args(["submodule", "-q", "sync"])
1381+
.arg(relative_path)
1382+
.run(&self);
13821383

13831384
// Try passing `--progress` to start, then run git again without if that fails.
13841385
let update = |progress: bool| {
@@ -1407,26 +1408,23 @@ impl Config {
14071408
git.arg(relative_path);
14081409
git
14091410
};
1410-
if !self.check_run(&mut update(true)) {
1411-
self.check_run(&mut update(false));
1411+
if !update(true).allow_failure().run(&self) {
1412+
update(false).allow_failure().run(&self);
14121413
}
14131414

14141415
// Save any local changes, but avoid running `git stash pop` if there are none (since it will exit with an error).
14151416
// diff-index reports the modifications through the exit status
1416-
let has_local_modifications = !self.check_run(submodule_git().allow_failure().args([
1417-
"diff-index",
1418-
"--quiet",
1419-
"HEAD",
1420-
]));
1417+
let has_local_modifications =
1418+
!submodule_git().allow_failure().args(["diff-index", "--quiet", "HEAD"]).run(&self);
14211419
if has_local_modifications {
1422-
self.check_run(submodule_git().args(["stash", "push"]));
1420+
submodule_git().allow_failure().args(["stash", "push"]).run(&self);
14231421
}
14241422

1425-
self.check_run(submodule_git().args(["reset", "-q", "--hard"]));
1426-
self.check_run(submodule_git().args(["clean", "-qdfx"]));
1423+
submodule_git().allow_failure().args(["reset", "-q", "--hard"]).run(&self);
1424+
submodule_git().allow_failure().args(["clean", "-qdfx"]).run(&self);
14271425

14281426
if has_local_modifications {
1429-
self.check_run(submodule_git().args(["stash", "pop"]));
1427+
submodule_git().allow_failure().args(["stash", "pop"]).run(&self);
14301428
}
14311429
}
14321430

0 commit comments

Comments
 (0)