about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-06-14 17:09:25 +0530
committerbit-aloo <sshourya17@gmail.com>2025-06-14 17:09:25 +0530
commite11e6400139112ade157c7a517f84a4521d055b4 (patch)
tree4d804b345a2c5abee71ae82ac5c7899e892fe73f /src/bootstrap
parent64033a4ee541c3e9c178fd593e979c74bb798cdc (diff)
downloadrust-e11e6400139112ade157c7a517f84a4521d055b4.tar.gz
rust-e11e6400139112ade157c7a517f84a4521d055b4.zip
replace all instances of check_run in config with execution context
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/config/config.rs32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 970a982dae4..8eb13fab251 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -1373,12 +1373,13 @@ impl Config {
         }
 
         println!("Updating submodule {relative_path}");
-        self.check_run(
-            helpers::git(Some(&self.src))
-                .run_always()
-                .args(["submodule", "-q", "sync"])
-                .arg(relative_path),
-        );
+
+        helpers::git(Some(&self.src))
+            .allow_failure()
+            .run_always()
+            .args(["submodule", "-q", "sync"])
+            .arg(relative_path)
+            .run(&self);
 
         // Try passing `--progress` to start, then run git again without if that fails.
         let update = |progress: bool| {
@@ -1407,26 +1408,23 @@ impl Config {
             git.arg(relative_path);
             git
         };
-        if !self.check_run(&mut update(true)) {
-            self.check_run(&mut update(false));
+        if !update(true).allow_failure().run(&self) {
+            update(false).allow_failure().run(&self);
         }
 
         // Save any local changes, but avoid running `git stash pop` if there are none (since it will exit with an error).
         // diff-index reports the modifications through the exit status
-        let has_local_modifications = !self.check_run(submodule_git().allow_failure().args([
-            "diff-index",
-            "--quiet",
-            "HEAD",
-        ]));
+        let has_local_modifications =
+            !submodule_git().allow_failure().args(["diff-index", "--quiet", "HEAD"]).run(&self);
         if has_local_modifications {
-            self.check_run(submodule_git().args(["stash", "push"]));
+            submodule_git().allow_failure().args(["stash", "push"]).run(&self);
         }
 
-        self.check_run(submodule_git().args(["reset", "-q", "--hard"]));
-        self.check_run(submodule_git().args(["clean", "-qdfx"]));
+        submodule_git().allow_failure().args(["reset", "-q", "--hard"]).run(&self);
+        submodule_git().allow_failure().args(["clean", "-qdfx"]).run(&self);
 
         if has_local_modifications {
-            self.check_run(submodule_git().args(["stash", "pop"]));
+            submodule_git().allow_failure().args(["stash", "pop"]).run(&self);
         }
     }