pub fn run_command(&self, command: &mut Command) -> anyhow::Result<()> {
        let checkout_path = self.checkout_path.path();
        command.current_dir(checkout_path);

        let temp_key_path = self.credentials.write_temporary_ssh_key()?;
        command.env(
            "GIT_SSH_COMMAND",
            format!(
                "ssh -o StrictHostKeyChecking=accept-new -i {}",
                temp_key_path.display()
            ),
        );

        let output = command.output()?;
        if !output.status.success() {
            let stderr = String::from_utf8_lossy(&output.stderr);
            return Err(anyhow!("Running git command failed with: {}", stderr));
        }

        Ok(())
    }
/// Runs the specified `git` command in the working directory of the local
/// crate index repository.
///
/// This function also temporarily sets the `GIT_SSH_COMMAND` environment
/// variable to ensure that `git push` commands are able to succeed.
Runs the specified `git` command in the working directory of the local
crate index repository.

This function also temporarily sets the `GIT_SSH_COMMAND` environment
variable to ensure that `git push` commands are able to succeed.
Runs the specified ` git ` command in the working directory of the local crate index repository . This function also temporarily sets the ` GIT_SSH_COMMAND ` environment variable to ensure that ` git push ` commands are able to succeed .
pub fn run_command(&self, command: &mut Command) -> anyhow::Result<()> {
        let checkout_path = self.checkout_path.path();
        command.current_dir(checkout_path);
        let temp_key_path = self.credentials.write_temporary_ssh_key()?;
        command.env(
            "GIT_SSH_COMMAND",
            format!(
                "ssh -o StrictHostKeyChecking=accept-new -i {}",
                temp_key_path.display()
            ),
        );
        let output = command.output()?;
        if !output.status.success() {
            let stderr = String::from_utf8_lossy(&output.stderr);
            return Err(anyhow!("Running git command failed with: {}", stderr));
        }
        Ok(())
    }
pub fn run_command ( & self , command : & mut Command ) -> anyhow :: Result < ( ) > { let checkout_path = self . checkout_path . path ( ) ; command . current_dir ( checkout_path ) ; let temp_key_path = self . credentials . write_temporary_ssh_key ( ) ? ; command . env ( " " , format ! ( " " temp_key_path display ( ) ) , ) ; let output = command . output ( ) ? ; if ! output . status . success ( ) { let stderr = String :: from_utf8_lossy ( & output . stderr ) ; return Err ( anyhow ! ( " " stderr ) ) ; } Ok ( ( ) ) }
Runs the specified `git` command in the working directory of the local
crate index repository.
Runs the specified ` git ` command in the working directory of the local crate index repository .
&self
command
&mut Command