Skip to content

Commit

Permalink
don't use absolute paths on git(Some(self.src))
Browse files Browse the repository at this point in the history
It will run at the project root, so resolving absolute/top-level paths
is unnecessary.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Oct 27, 2024
1 parent f7cf41c commit a826133
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 1 addition & 8 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a826133

Please sign in to comment.