From c2946446976d9275c28a82862d78a07dea8e5029 Mon Sep 17 00:00:00 2001 From: Rohit kumar Date: Fri, 22 Nov 2024 17:20:13 +0530 Subject: [PATCH] PR Clone fix --- src/utils/common.rs | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/utils/common.rs b/src/utils/common.rs index 445ba05..6c3370b 100644 --- a/src/utils/common.rs +++ b/src/utils/common.rs @@ -417,26 +417,17 @@ fn save_pr_branch_files( Ok(()) } -fn set_git_user_config() -> Result<(), Box> { - let email_output = Command::new("git") - .args(&["config", "--get", "user.email"]) +// Set global Git config for user email and name +fn set_git_global_user_config() -> Result<(), Box> { + // Set global email + Command::new("git") + .args(&["config", "--global", "user.email", "helabot@groww.in"]) .output()?; - if !email_output.status.success() { - // Set default email if not already configured - Command::new("git") - .args(&["config", "--local", "user.email", "temp@example.com"]) - .output()?; - } - let name_output = Command::new("git") - .args(&["config", "--get", "user.name"]) + // Set global name + Command::new("git") + .args(&["config", "--global", "user.name", "Hela Bot"]) .output()?; - if !name_output.status.success() { - // Set default name if not already configured - Command::new("git") - .args(&["config", "--local", "user.name", "Temporary User"]) - .output()?; - } Ok(()) }