fn ensure_source(source: Option<CommitSpec>) -> Result<CommitSpec, i32> {
    if let Some(source) = source {
        return Ok(source);
    }
    match find_target() {
        Ok(Some(target)) => {
            eprintln!("Using remembered value {:?}", short_branch(&target.spec));
            Ok(target)
        }
        Ok(None) => {
            eprintln!("Source not supplied and no remembered source.");
            Err(1)
        }
        Err(err) => {
            eprintln!("{}", err);
            Err(1)
        }
    }
}
/// Ensure a source branch is set, falling back to remembered branch.
Ensure a source branch is set, falling back to remembered branch.
Ensure a source branch is set falling back to remembered branch .
fn ensure_source(source: Option<CommitSpec>) -> Result<CommitSpec, i32> {
    if let Some(source) = source {
        return Ok(source);
    }
    match find_target() {
        Ok(Some(target)) => {
            eprintln!("Using remembered value {:?}", short_branch(&target.spec));
            Ok(target)
        }
        Ok(None) => {
            eprintln!("Source not supplied and no remembered source.");
            Err(1)
        }
        Err(err) => {
            eprintln!("{}", err);
            Err(1)
        }
    }
}
fn ensure_source ( source : Option < CommitSpec > ) -> Result < CommitSpec , i32 > { if let Some ( source ) = source { return Ok ( source ) ; } match find_target ( ) { Ok ( Some ( target ) ) => { eprintln ! ( " " short_branch ( target spec ) ) ; Ok ( target ) } Ok ( None ) => { eprintln ! ( " " ) ; Err ( 1 ) } Err ( err ) => { eprintln ! ( " " err ) ; Err ( 1 ) } } }
Ensure a source branch is set, falling back to remembered branch.
Ensure a source branch is set falling back to remembered branch .
source
Option<CommitSpec>
source
Option<CommitSpec>