Skip to content

Commit

Permalink
PR Clone fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitcoder committed Nov 22, 2024
1 parent 15fdc9c commit c294644
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/utils/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,26 +417,17 @@ fn save_pr_branch_files(
Ok(())
}

fn set_git_user_config() -> Result<(), Box<dyn std::error::Error>> {
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<dyn std::error::Error>> {
// Set global email
Command::new("git")
.args(&["config", "--global", "user.email", "[email protected]"])
.output()?;
if !email_output.status.success() {
// Set default email if not already configured
Command::new("git")
.args(&["config", "--local", "user.email", "[email protected]"])
.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(())
}
Expand Down

0 comments on commit c294644

Please sign in to comment.