From daf0fc88393cd9f82cd865f6bc19a05e24dbd12a Mon Sep 17 00:00:00 2001 From: kjuulh Date: Tue, 1 Aug 2023 22:40:52 +0200 Subject: [PATCH] feat: set username and email Signed-off-by: kjuulh --- crates/cuddle-please-misc/src/git_client.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/cuddle-please-misc/src/git_client.rs b/crates/cuddle-please-misc/src/git_client.rs index e8c213b..324ffcc 100644 --- a/crates/cuddle-please-misc/src/git_client.rs +++ b/crates/cuddle-please-misc/src/git_client.rs @@ -52,9 +52,19 @@ impl VcsClient { fn exec_git(&self, args: &[&str]) -> anyhow::Result<()> { match self { VcsClient::Noop {} => {} - VcsClient::Git { source, .. } => { + VcsClient::Git { + source, + username, + email, + } => { let checkout_branch = std::process::Command::new("git") .current_dir(source.as_path()) + .args(&[ + "-c", + &format!("user.name={}", username), + "-c", + &format!("user.email={}", email), + ]) .args(args) .output()?;