pub fn clone(&mut self, url: &str, into: &Path) -> Result<Repository, Error> {
        let mut opts: raw::git_clone_options = unsafe { mem::zeroed() };
        unsafe {
            try_call!(raw::git_clone_init_options(
                &mut opts,
                raw::GIT_CLONE_OPTIONS_VERSION
            ));
        }
        opts.bare = self.bare as c_int;
        opts.checkout_branch = self
            .branch
            .as_ref()
            .map(|s| s.as_ptr())
            .unwrap_or(ptr::null());

        if let Some(ref local) = self.clone_local {
            opts.local = *local as raw::git_clone_local_t;
        } else {
            opts.local = match (self.local, self.hardlinks) {
                (true, false) => raw::GIT_CLONE_LOCAL_NO_LINKS,
                (false, _) => raw::GIT_CLONE_NO_LOCAL,
                (true, _) => raw::GIT_CLONE_LOCAL_AUTO,
            };
        }

        if let Some(ref mut cbs) = self.fetch_opts {
            opts.fetch_opts = cbs.raw();
        }

        if let Some(ref mut c) = self.checkout {
            unsafe {
                c.configure(&mut opts.checkout_opts);
            }
        }

        if let Some(ref mut callback) = self.remote_create {
            opts.remote_cb = Some(remote_create_cb);
            opts.remote_cb_payload = callback as *mut _ as *mut _;
        }

        let url = CString::new(url)?;
        // Normal file path OK (does not need Windows conversion).
        let into = into.into_c_string()?;
        let mut raw = ptr::null_mut();
        unsafe {
            try_call!(raw::git_clone(&mut raw, url, into, &opts));
            Ok(Binding::from_raw(raw))
        }
    }
/// Clone a remote repository.
///
/// This will use the options configured so far to clone the specified url
/// into the specified local path.
Clone a remote repository.
This will use the options configured so far to clone the specified url
into the specified local path.
Clone a remote repository . This will use the options configured so far to clone the specified url into the specified local path .
pub fn clone(&mut self, url: &str, into: &Path) -> Result<Repository, Error> {
        let mut opts: raw::git_clone_options = unsafe { mem::zeroed() };
        unsafe {
            try_call!(raw::git_clone_init_options(
                &mut opts,
                raw::GIT_CLONE_OPTIONS_VERSION
            ));
        }
        opts.bare = self.bare as c_int;
        opts.checkout_branch = self
            .branch
            .as_ref()
            .map(|s| s.as_ptr())
            .unwrap_or(ptr::null());
        if let Some(ref local) = self.clone_local {
            opts.local = *local as raw::git_clone_local_t;
        } else {
            opts.local = match (self.local, self.hardlinks) {
                (true, false) => raw::GIT_CLONE_LOCAL_NO_LINKS,
                (false, _) => raw::GIT_CLONE_NO_LOCAL,
                (true, _) => raw::GIT_CLONE_LOCAL_AUTO,
            };
        }
        if let Some(ref mut cbs) = self.fetch_opts {
            opts.fetch_opts = cbs.raw();
        }
        if let Some(ref mut c) = self.checkout {
            unsafe {
                c.configure(&mut opts.checkout_opts);
            }
        }
        if let Some(ref mut callback) = self.remote_create {
            opts.remote_cb = Some(remote_create_cb);
            opts.remote_cb_payload = callback as *mut _ as *mut _;
        }
        let url = CString::new(url)?;
        // Normal file path OK (does not need Windows conversion).
        let into = into.into_c_string()?;
        let mut raw = ptr::null_mut();
        unsafe {
            try_call!(raw::git_clone(&mut raw, url, into, &opts));
            Ok(Binding::from_raw(raw))
        }
    }
pub fn clone ( & mut self , url : & str , into : & Path ) -> Result < Repository , Error > { let mut opts : raw :: git_clone_options = unsafe { mem :: zeroed ( ) } ; unsafe { try_call ! ( raw git_clone_init_options ( mut opts raw GIT_CLONE_OPTIONS_VERSION ) ) ; } opts . bare = self . bare as c_int ; opts . checkout_branch = self . branch . as_ref ( ) . map ( | s | s . as_ptr ( ) ) . unwrap_or ( ptr :: null ( ) ) ; if let Some ( ref local ) = self . clone_local { opts . local = * local as raw :: git_clone_local_t ; } else { opts . local = match ( self . local , self . hardlinks ) { ( true , false ) => raw :: GIT_CLONE_LOCAL_NO_LINKS , ( false , _ ) => raw :: GIT_CLONE_NO_LOCAL , ( true , _ ) => raw :: GIT_CLONE_LOCAL_AUTO , } ; } if let Some ( ref mut cbs ) = self . fetch_opts { opts . fetch_opts = cbs . raw ( ) ; } if let Some ( ref mut c ) = self . checkout { unsafe { c . configure ( & mut opts . checkout_opts ) ; } } if let Some ( ref mut callback ) = self . remote_create { opts . remote_cb = Some ( remote_create_cb ) ; opts . remote_cb_payload = callback as * mut _ as * mut _ ; } let url = CString :: new ( url ) ? ; // Normal file path OK (does not need Windows conversion). let into = into . into_c_string ( ) ? ; let mut raw = ptr :: null_mut ( ) ; unsafe { try_call ! ( raw git_clone ( mut raw url into opts ) ) ; Ok ( Binding :: from_raw ( raw ) ) } }
Clone a remote repository.
Clone a remote repository .
&mut self
url
&str
into
&Path
&mut self
url
&str
into
&Path