Skip to content

Commit a826133

Browse files
committed
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 <[email protected]>
1 parent f7cf41c commit a826133

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

Diff for: src/bootstrap/src/core/build_steps/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl Step for Std {
135135
!t!(helpers::git(Some(&builder.src))
136136
.args(["diff-index", "--quiet", &closest_merge_commit])
137137
.arg("--")
138-
.arg(builder.src.join("library"))
138+
.arg("library")
139139
.as_command_mut()
140140
.status())
141141
.success()

Diff for: src/bootstrap/src/core/config/config.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -2871,14 +2871,7 @@ impl Config {
28712871

28722872
// Warn if there were changes to the compiler or standard library since the ancestor commit.
28732873
let mut git = helpers::git(Some(&self.src));
2874-
git.args(["diff-index", "--quiet", &commit, "--"]);
2875-
2876-
// Handle running from a directory other than the top level
2877-
let top_level = &self.src;
2878-
2879-
for path in modified_paths {
2880-
git.arg(top_level.join(path));
2881-
}
2874+
git.args(["diff-index", "--quiet", &commit, "--"]).args(modified_paths);
28822875

28832876
let has_changes = !t!(git.as_command_mut().status()).success();
28842877
if has_changes {

Diff for: src/bootstrap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ impl Build {
541541
}
542542
let output = helpers::git(Some(&self.src))
543543
.args(["config", "--file"])
544-
.arg(self.config.src.join(".gitmodules"))
544+
.arg(".gitmodules")
545545
.args(["--get-regexp", "path"])
546546
.run_capture(self)
547547
.stdout();

0 commit comments

Comments
 (0)