-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15fdc9c
commit c294644
Showing
1 changed file
with
8 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(()) | ||
} | ||
|