pub fn sync(project_name: &str, project: &GlProject) -> Result<()> {
        print!("\n{}: Syncing...\r", project_name);
        if project.path.exists() {
            let git = Self::open(&project.path)?;
            let fetch_commit = do_fetch(&git.repo, project_name, project)?;
            do_merge(&git.repo, &project.reference, fetch_commit)?;
        } else {
            let fops = fetch_options(project_name);
            let co = CheckoutBuilder::new();
            let mut builder = git2::build::RepoBuilder::new();
            builder.fetch_options(fops).with_checkout(co);
            let repo = builder
                .clone(&project.fetch_url, &project.path)
                .map_err(|e| Error::Git("clone", e))?;
            let fetch_commit = do_fetch(&repo, project_name, project)?;
            do_merge(&repo, &project.reference, fetch_commit)?;
        }
        Ok(())
    }
///
/// Sync with upstream
/// Doing clone path not exists
/// Doing fetch if exists
///
/// Return git object or an Error
Sync with upstream
Doing clone path not exists
Doing fetch if exists

Return git object or an Error
Sync with upstream Doing clone path not exists Doing fetch if exists Return git object or an Error
pub fn sync(project_name: &str, project: &GlProject) -> Result<()> {
        print!("\n{}: Syncing...\r", project_name);
        if project.path.exists() {
            let git = Self::open(&project.path)?;
            let fetch_commit = do_fetch(&git.repo, project_name, project)?;
            do_merge(&git.repo, &project.reference, fetch_commit)?;
        } else {
            let fops = fetch_options(project_name);
            let co = CheckoutBuilder::new();
            let mut builder = git2::build::RepoBuilder::new();
            builder.fetch_options(fops).with_checkout(co);
            let repo = builder
                .clone(&project.fetch_url, &project.path)
                .map_err(|e| Error::Git("clone", e))?;
            let fetch_commit = do_fetch(&repo, project_name, project)?;
            do_merge(&repo, &project.reference, fetch_commit)?;
        }
        Ok(())
    }
pub fn sync ( project_name : & str , project : & GlProject ) -> Result < ( ) > { print ! ( " \n \r " project_name ) ; if project . path . exists ( ) { let git = Self :: open ( & project . path ) ? ; let fetch_commit = do_fetch ( & git . repo , project_name , project ) ? ; do_merge ( & git . repo , & project . reference , fetch_commit ) ? ; } else { let fops = fetch_options ( project_name ) ; let co = CheckoutBuilder :: new ( ) ; let mut builder = git2 :: build :: RepoBuilder :: new ( ) ; builder . fetch_options ( fops ) . with_checkout ( co ) ; let repo = builder . clone ( & project . fetch_url , & project . path ) . map_err ( | e | Error :: Git ( " " , e ) ) ? ; let fetch_commit = do_fetch ( & repo , project_name , project ) ? ; do_merge ( & repo , & project . reference , fetch_commit ) ? ; } Ok ( ( ) ) }
Sync with upstream
Doing clone path not exists
Doing fetch if exists
Sync with upstream Doing clone path not exists Doing fetch if exists
project_name
&str
project
&GlProject
project_name
&str
project
&GlProject