added example
This commit is contained in:
@@ -80,7 +80,7 @@ impl Error for GitError {
|
||||
*/
|
||||
pub fn git_clone(url: &str) -> Result<String, GitError> {
|
||||
// Check if git is installed
|
||||
let git_check = Command::new("git")
|
||||
let _git_check = Command::new("git")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.map_err(GitError::GitNotInstalled)?;
|
||||
|
@@ -293,17 +293,6 @@ impl GitExecutor {
|
||||
|
||||
// Execute git command with username/password
|
||||
fn execute_with_credentials(&self, args: &[&str], username: &str, password: &str) -> Result<Output, GitExecutorError> {
|
||||
// Helper method to execute a command and handle the result
|
||||
fn execute_command(command: &mut Command) -> Result<Output, GitExecutorError> {
|
||||
let output = command.output()?;
|
||||
|
||||
if output.status.success() {
|
||||
Ok(output)
|
||||
} else {
|
||||
let error = String::from_utf8_lossy(&output.stderr);
|
||||
Err(GitExecutorError::GitCommandFailed(error.to_string()))
|
||||
}
|
||||
}
|
||||
// For HTTPS authentication, we need to modify the URL to include credentials
|
||||
// Create a new vector to hold our modified arguments
|
||||
let modified_args: Vec<String> = args.iter().map(|&arg| {
|
||||
|
Reference in New Issue
Block a user