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>
This commit is contained in:
onur-ozkan 2024-10-27 08:38:20 +03:00
parent f7cf41c973
commit a8261333e1
3 changed files with 3 additions and 10 deletions

View File

@ -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()

View File

@ -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 {

View File

@ -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();