Struct git2::build::RepoBuilder [] [src]

pub struct RepoBuilder<'cb> {
    // some fields omitted
}

A builder struct which is used to build configuration for cloning a new git repository.

Methods

impl<'cb> RepoBuilder<'cb>
[src]

fn new() -> RepoBuilder<'cb>

Creates a new repository builder with all of the default configuration.

When ready, the clone() method can be used to clone a new repository using this configuration.

fn bare(&mut self, bare: bool) -> &mut RepoBuilder<'cb>

Indicate whether the repository will be cloned as a bare repository or not.

fn branch(&mut self, branch: &str) -> &mut RepoBuilder<'cb>

Specify the name of the branch to check out after the clone.

If not specified, the remote's default branch will be used.

fn local(&mut self, local: bool) -> &mut RepoBuilder<'cb>

Set the flag for bypassing the git aware transport mechanism for local paths.

If true, the git-aware transport will be bypassed for local paths. If false, the git-aware transport will not be bypassed.

Set the flag for whether hardlinks are used when using a local git-aware transport mechanism.

fn with_checkout(&mut self, checkout: CheckoutBuilder<'cb>) -> &mut RepoBuilder<'cb>

Configure the checkout which will be performed by consuming a checkout builder.

fn fetch_options(&mut self, fetch_opts: FetchOptions<'cb>) -> &mut RepoBuilder<'cb>

Options which control the fetch, including callbacks.

The callbacks are used for reporting fetch progress, and for acquiring credentials in the event they are needed.

fn clone(&mut self, url: &str, into: &Path) -> Result<RepositoryError>

Clone a remote repository.

This will use the options configured so far to clone the specified url into the specified local path.