Skip to content

Commit 1257fbd

Browse files
committed
fix: prevent terminal windows from popping up if code is run from a graphical UI on Windows
1 parent f6cd919 commit 1257fbd

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

gitoxide-core/src/repository/attributes/validate_baseline.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ pub(crate) mod function {
7474
let tx_base = tx_base.clone();
7575
let mut progress = progress.add_child("attributes");
7676
move || -> anyhow::Result<()> {
77-
let mut child = std::process::Command::new(gix::path::env::exe_invocation())
78-
.args(["check-attr", "--stdin", "-a"])
79-
.stdin(std::process::Stdio::piped())
80-
.stdout(std::process::Stdio::piped())
81-
.stderr(std::process::Stdio::null())
82-
.current_dir(path)
83-
.spawn()?;
77+
let mut child =
78+
std::process::Command::from(gix::command::prepare(gix::path::env::exe_invocation()))
79+
.args(["check-attr", "--stdin", "-a"])
80+
.stdin(std::process::Stdio::piped())
81+
.stdout(std::process::Stdio::piped())
82+
.stderr(std::process::Stdio::null())
83+
.current_dir(path)
84+
.spawn()?;
8485

8586
std::thread::spawn({
8687
let mut stdin = child.stdin.take().expect("we configured it");
@@ -125,13 +126,14 @@ pub(crate) mod function {
125126
let tx_base = tx_base.clone();
126127
let mut progress = progress.add_child("excludes");
127128
move || -> anyhow::Result<()> {
128-
let mut child = std::process::Command::new(gix::path::env::exe_invocation())
129-
.args(["check-ignore", "--stdin", "-nv", "--no-index"])
130-
.stdin(std::process::Stdio::piped())
131-
.stdout(std::process::Stdio::piped())
132-
.stderr(std::process::Stdio::null())
133-
.current_dir(path)
134-
.spawn()?;
129+
let mut child =
130+
std::process::Command::from(gix::command::prepare(gix::path::env::exe_invocation()))
131+
.args(["check-ignore", "--stdin", "-nv", "--no-index"])
132+
.stdin(std::process::Stdio::piped())
133+
.stdout(std::process::Stdio::piped())
134+
.stderr(std::process::Stdio::null())
135+
.current_dir(path)
136+
.spawn()?;
135137

136138
std::thread::spawn({
137139
let mut stdin = child.stdin.take().expect("we configured it");

gitoxide-core/src/repository/commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn verify(repo: gix::Repository, rev_spec: Option<&str>) -> Result<()> {
2020
signature_storage.write_all(signature.as_ref())?;
2121
let signed_storage = signature_storage.into_temp_path();
2222

23-
let mut cmd = std::process::Command::new("gpg");
23+
let mut cmd: std::process::Command = gix::command::prepare("gpg").into();
2424
cmd.args(["--keyid-format=long", "--status-fd=1", "--verify"])
2525
.arg(&signed_storage)
2626
.arg("-")

0 commit comments

Comments
 (0)