pub fn merge_base(&self, commit_ref: &str) -> Result<GitHash> {
        let output = self
            .git_command()
            .args(&["merge-base", "HEAD", commit_ref])
            .output()
            .map_err(|err| {
                SystemError::io(format!("running git merge-base HEAD {}", commit_ref), err)
            })?;
        if !output.status.success() {
            return Err(SystemError::Exec {
                cmd: "git merge-base",
                status: output.status,
            });
        }

        // The output is a hex-encoded hash followed by a newline.
        let stdout = &output.stdout[..(output.stdout.len() - 1)];
        GitHash::from_hex(stdout)
    }
/// Returns the merge base of the current commit (`HEAD`) with the specified commit.
Returns the merge base of the current commit (`HEAD`) with the specified commit.
Returns the merge base of the current commit ( ` HEAD ` ) with the specified commit .
pub fn merge_base(&self, commit_ref: &str) -> Result<GitHash> {
        let output = self
            .git_command()
            .args(&["merge-base", "HEAD", commit_ref])
            .output()
            .map_err(|err| {
                SystemError::io(format!("running git merge-base HEAD {}", commit_ref), err)
            })?;
        if !output.status.success() {
            return Err(SystemError::Exec {
                cmd: "git merge-base",
                status: output.status,
            });
        }
        // The output is a hex-encoded hash followed by a newline.
        let stdout = &output.stdout[..(output.stdout.len() - 1)];
        GitHash::from_hex(stdout)
    }
pub fn merge_base ( & self , commit_ref : & str ) -> Result < GitHash > { let output = self . git_command ( ) . args ( & [ " " , " " , commit_ref ] ) . output ( ) . map_err ( | err | { SystemError :: io ( format ! ( " " commit_ref ) , err ) } ) ? ; if ! output . status . success ( ) { return Err ( SystemError :: Exec { cmd : " " , status : output . status , } ) ; } // The output is a hex-encoded hash followed by a newline. let stdout = & output . stdout [ .. ( output . stdout . len ( ) - 1 ) ] ; GitHash :: from_hex ( stdout ) }
Returns the merge base of the current commit (`HEAD`) with the specified commit.
Returns the merge base of the current commit ( ` HEAD ` ) with the specified commit .
&self
commit_ref
&str