Struct git2::RepositoryInitOptions [] [src]

pub struct RepositoryInitOptions { /* fields omitted */ }

Options which can be used to configure how a repository is initialized

Methods

impl RepositoryInitOptions
[src]

[src]

Creates a default set of initialization options.

By default this will set flags for creating all necessary directories and initializing a directory from the user-configured templates path.

[src]

Create a bare repository with no working directory.

Defaults to false.

[src]

Return an error if the repository path appears to already be a git repository.

Defaults to false.

[src]

Normally a '/.git/' will be appended to the repo apth for non-bare repos (if it is not already there), but passing this flag prevents that behavior.

Defaults to false.

[src]

Make the repo path (and workdir path) as needed. The ".git" directory will always be created regardless of this flag.

Defaults to true.

[src]

Recursively make all components of the repo and workdir path sas necessary.

Defaults to true.

[src]

Set to one of the RepositoryInit constants, or a custom value.

[src]

Enable or disable using external templates.

If enabled, then the template_path option will be queried first, then init.templatedir from the global config, and finally /usr/share/git-core-templates will be used (if it exists).

Defaults to true.

[src]

The path do the working directory.

If this is a relative path it will be evaulated relative to the repo path. If this is not the "natural" working directory, a .git gitlink file will be created here linking to the repo path.

[src]

If set, this will be used to initialize the "description" file in the repository instead of using the template content.

[src]

When the external_template option is set, this is the first location to check for the template directory.

If this is not configured, then the default locations will be searched instead.

[src]

The name of the head to point HEAD at.

If not configured, this will be treated as master and the HEAD ref will be set to refs/heads/master. If this begins with refs/ it will be used verbatim; otherwise refs/heads/ will be prefixed

[src]

If set, then after the rest of the repository initialization is completed an origin remote will be added pointing to this URL.

[src]

Creates a set of raw init options to be used with git_repository_init_ext.

This method is unsafe as the returned value may have pointers to the interior of this structure.