fn open(&self) -> CargoResult<git2::Repository> {
        match git2::Repository::open(&self.checkout_path) {
            Ok(repo) => return Ok(repo),
            Err(..) => {}
        }

        try!(fs::create_dir_all(&self.checkout_path));
        let _ = fs::remove_dir_all(&self.checkout_path);
        let repo = try!(git2::Repository::init(&self.checkout_path));
        Ok(repo)
    }
/// Open the git repository for the index of the registry.
///
/// This will attempt to open an existing checkout, and failing that it will
/// initialize a fresh new directory and git checkout. No remotes will be
/// configured by default.
Open the git repository for the index of the registry.
This will attempt to open an existing checkout, and failing that it will
initialize a fresh new directory and git checkout. No remotes will be
configured by default.
Open the git repository for the index of the registry . This will attempt to open an existing checkout and failing that it will initialize a fresh new directory and git checkout . No remotes will be configured by default .
fn open(&self) -> CargoResult<git2::Repository> {
        match git2::Repository::open(&self.checkout_path) {
            Ok(repo) => return Ok(repo),
            Err(..) => {}
        }
        try!(fs::create_dir_all(&self.checkout_path));
        let _ = fs::remove_dir_all(&self.checkout_path);
        let repo = try!(git2::Repository::init(&self.checkout_path));
        Ok(repo)
    }
fn open ( & self ) -> CargoResult < git2 :: Repository > { match git2 :: Repository :: open ( & self . checkout_path ) { Ok ( repo ) => return Ok ( repo ) , Err ( .. ) => { } } try ! ( fs create_dir_all ( self checkout_path ) ) ; let _ = fs :: remove_dir_all ( & self . checkout_path ) ; let repo = try ! ( git2 Repository init ( self checkout_path ) ) ; Ok ( repo ) }
Open the git repository for the index of the registry.
Open the git repository for the index of the registry .
&self
&self