Skip to content

Commit

Permalink
fix: prevent terminal windows from popping up if code is run from a g…
Browse files Browse the repository at this point in the history
…raphical UI on Windows
  • Loading branch information
Byron committed Aug 10, 2024
1 parent f6cd919 commit 1257fbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 16 additions & 14 deletions gitoxide-core/src/repository/attributes/validate_baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ pub(crate) mod function {
let tx_base = tx_base.clone();
let mut progress = progress.add_child("attributes");
move || -> anyhow::Result<()> {
let mut child = std::process::Command::new(gix::path::env::exe_invocation())
.args(["check-attr", "--stdin", "-a"])
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
.current_dir(path)
.spawn()?;
let mut child =
std::process::Command::from(gix::command::prepare(gix::path::env::exe_invocation()))
.args(["check-attr", "--stdin", "-a"])
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
.current_dir(path)
.spawn()?;

std::thread::spawn({
let mut stdin = child.stdin.take().expect("we configured it");
Expand Down Expand Up @@ -125,13 +126,14 @@ pub(crate) mod function {
let tx_base = tx_base.clone();
let mut progress = progress.add_child("excludes");
move || -> anyhow::Result<()> {
let mut child = std::process::Command::new(gix::path::env::exe_invocation())
.args(["check-ignore", "--stdin", "-nv", "--no-index"])
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
.current_dir(path)
.spawn()?;
let mut child =
std::process::Command::from(gix::command::prepare(gix::path::env::exe_invocation()))
.args(["check-ignore", "--stdin", "-nv", "--no-index"])
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::null())
.current_dir(path)
.spawn()?;

std::thread::spawn({
let mut stdin = child.stdin.take().expect("we configured it");
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn verify(repo: gix::Repository, rev_spec: Option<&str>) -> Result<()> {
signature_storage.write_all(signature.as_ref())?;
let signed_storage = signature_storage.into_temp_path();

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

0 comments on commit 1257fbd

Please sign in to comment.