diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-10-27 08:38:20 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-10-27 08:38:20 +0300 |
| commit | a8261333e12bb64a4f2071a0c320d583b9f083da (patch) | |
| tree | b9cf2c9772ead8bf1b6db9409164f13ec5875be7 | |
| parent | f7cf41c97350f972d7281c20ed2d0c3744329023 (diff) | |
| download | rust-a8261333e12bb64a4f2071a0c320d583b9f083da.tar.gz rust-a8261333e12bb64a4f2071a0c320d583b9f083da.zip | |
don't use absolute paths on `git(Some(self.src))`
It will run at the project root, so resolving absolute/top-level paths is unnecessary. Signed-off-by: onur-ozkan <work@onurozkan.dev>
| -rw-r--r-- | src/bootstrap/src/core/build_steps/compile.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 9 | ||||
| -rw-r--r-- | src/bootstrap/src/lib.rs | 2 |
3 files changed, 3 insertions, 10 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 27bbc8bd8ff..893fa9f79cb 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -135,7 +135,7 @@ impl Step for Std { !t!(helpers::git(Some(&builder.src)) .args(["diff-index", "--quiet", &closest_merge_commit]) .arg("--") - .arg(builder.src.join("library")) + .arg("library") .as_command_mut() .status()) .success() diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 087dde0d9c6..139ca7eb52e 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -2871,14 +2871,7 @@ impl Config { // Warn if there were changes to the compiler or standard library since the ancestor commit. let mut git = helpers::git(Some(&self.src)); - git.args(["diff-index", "--quiet", &commit, "--"]); - - // Handle running from a directory other than the top level - let top_level = &self.src; - - for path in modified_paths { - git.arg(top_level.join(path)); - } + git.args(["diff-index", "--quiet", &commit, "--"]).args(modified_paths); let has_changes = !t!(git.as_command_mut().status()).success(); if has_changes { diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index a9db0377a50..ba74cabcd30 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -541,7 +541,7 @@ impl Build { } let output = helpers::git(Some(&self.src)) .args(["config", "--file"]) - .arg(self.config.src.join(".gitmodules")) + .arg(".gitmodules") .args(["--get-regexp", "path"]) .run_capture(self) .stdout(); |
