Skip to content

Commit 54fa1a7

Browse files
committed
moved git command to new exec context
1 parent e75d6e5 commit 54fa1a7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,14 +445,9 @@ impl Config {
445445
// has already been (kinda-cross-)compiled to Windows land, we require a normal Windows path.
446446
cmd.arg("rev-parse").arg("--show-cdup");
447447
// Discard stderr because we expect this to fail when building from a tarball.
448-
let output = cmd
449-
.as_command_mut()
450-
.stderr(std::process::Stdio::null())
451-
.output()
452-
.ok()
453-
.and_then(|output| if output.status.success() { Some(output) } else { None });
454-
if let Some(output) = output {
455-
let git_root_relative = String::from_utf8(output.stdout).unwrap();
448+
let output = cmd.run_capture_stdout_exec_ctx(&config);
449+
if output.is_success() {
450+
let git_root_relative = output.stdout();
456451
// We need to canonicalize this path to make sure it uses backslashes instead of forward slashes,
457452
// and to resolve any relative components.
458453
let git_root = env::current_dir()

0 commit comments

Comments
 (0)