Skip to content

Commit 4d5e66b

Browse files
committed
refactor: remove unnecessary window creation flags
1 parent b52d562 commit 4d5e66b

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

crates/gitbutler-repo/src/repository_ext.rs

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ impl RepositoryExt for git2::Repository {
307307
.ok_or_else(|| anyhow::anyhow!("Failed to convert path to string"))?
308308
.to_string();
309309

310-
let output;
311310
// support literal ssh key
312311
if let (true, signing_key) = is_literal_ssh_key(&signing_key) {
313312
// write the key to a temp file
@@ -324,43 +323,23 @@ impl RepositoryExt for git2::Repository {
324323
}
325324

326325
let key_file_path = key_storage.into_temp_path();
327-
328326
let args = format!(
329327
"{} -U {}",
330328
key_file_path.to_string_lossy(),
331329
buffer_file_to_sign_path.to_string_lossy()
332330
);
333331
cmd_string += &args;
334-
335-
let mut signing_cmd: std::process::Command =
336-
gix::command::prepare(cmd_string).with_shell().into();
337-
338-
#[cfg(windows)]
339-
signing_cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
340-
341-
signing_cmd.stderr(Stdio::piped());
342-
signing_cmd.stdout(Stdio::piped());
343-
signing_cmd.stdin(Stdio::null());
344-
345-
let child = signing_cmd.spawn()?;
346-
output = child.wait_with_output()?;
347332
} else {
348333
let args = format!("{} {}", signing_key, buffer_file_to_sign_path_str);
349334
cmd_string += &args;
350-
351-
let mut signing_cmd: std::process::Command =
352-
gix::command::prepare(cmd_string).with_shell().into();
353-
354-
#[cfg(windows)]
355-
signing_cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
356-
357-
signing_cmd.stderr(Stdio::piped());
358-
signing_cmd.stdout(Stdio::piped());
359-
signing_cmd.stdin(Stdio::null());
360-
361-
let child = signing_cmd.spawn()?;
362-
output = child.wait_with_output()?;
363-
}
335+
};
336+
let mut signing_cmd: std::process::Command =
337+
gix::command::prepare(cmd_string).with_shell().into();
338+
let output = signing_cmd
339+
.stderr(Stdio::piped())
340+
.stdout(Stdio::piped())
341+
.stdin(Stdio::null())
342+
.output()?;
364343

365344
if output.status.success() {
366345
// read signed_storage path plus .sig

0 commit comments

Comments
 (0)