Skip to content

Commit

Permalink
Don't show command prompt when commit signing is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisbetts committed May 21, 2024
1 parent b1cf9b4 commit a47ebbc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/gitbutler-core/src/git/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use git2::{BlameOptions, Submodule};
use git2_hooks::HookResult;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
#[cfg(windows)]
use std::os::windows::process::CommandExt;
use std::process::Stdio;
use std::{io::Write, path::Path, str};

Expand Down Expand Up @@ -306,6 +308,9 @@ impl Repository {
std::process::Command::new(gpg_program.unwrap_or("ssh-keygen".to_string()));
cmd.args(["-Y", "sign", "-n", "git", "-f"]);

#[cfg(windows)]
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW

let output;
// support literal ssh key
if let (true, signing_key) = Self::is_literal_ssh_key(&signing_key) {
Expand Down Expand Up @@ -363,6 +368,9 @@ impl Repository {
.stdout(Stdio::piped())
.stdin(Stdio::piped());

#[cfg(windows)]
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW

let mut child = cmd.spawn()?;
child
.stdin
Expand Down

0 comments on commit a47ebbc

Please sign in to comment.