Skip to content

Commit 4bf10b6

Browse files
authored
Merge pull request #6028 from Byron/fix-6013
Fix #6013
2 parents 7701822 + bc482aa commit 4bf10b6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

crates/gitbutler-repo/src/repository_ext.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,13 @@ impl RepositoryExt for git2::Repository {
450450
}
451451

452452
let args = format!(
453-
"{} -U {}",
453+
"'{}' -U '{}'",
454454
key_storage.path().to_string_lossy(),
455455
buffer_file_to_sign_path_str,
456456
);
457457
cmd_string += &args;
458458
} else {
459-
let args = format!("{} {}", signing_key, buffer_file_to_sign_path_str);
459+
let args = format!("'{}' '{}'", signing_key, buffer_file_to_sign_path_str);
460460
cmd_string += &args;
461461
};
462462
let mut signing_cmd: std::process::Command = command_with_login_shell(cmd_string);
@@ -581,11 +581,13 @@ impl RepositoryExt for git2::Repository {
581581
}
582582

583583
pub fn command_with_login_shell(shell_cmd: impl Into<OsString>) -> std::process::Command {
584-
gix::command::prepare(shell_cmd)
584+
let cmd: std::process::Command = gix::command::prepare(shell_cmd)
585585
.with_shell_disallow_manual_argument_splitting()
586586
// On Windows, this yields the Git-bundled `sh.exe`, on Linux it uses `/bin/sh`.
587587
.with_shell_program(gix::path::env::shell())
588-
.into()
588+
.into();
589+
tracing::debug!(?cmd, "command to produce commit signature");
590+
cmd
589591
}
590592

591593
/// Signs the buffer with the configured gpg key, returning the signature.

0 commit comments

Comments
 (0)