pub struct GitContext { /* private fields */ }
Expand description

A context for performing git commands.

Implementations

Create a new context for the given directory.

Create a new context for the given directory with git configuration.

Run a git command in the context.

This builds a Command with the proper environment to operate within the context.

Fetch references from the given remote.

The remote is interpreted by Git, so it can be a remote or a specific URL.

Fetch a commit from the given remote into a specific local refname.

Fetch a commit from the given remote into a specific local refname, allowing rewinds.

Determine the “default branch” for the repository.

Create a tree where further work on the given revision can occur.

Reserve a refname for the given commit.

Returns the name of the reserved ref pointing to the given commit and its ID.

The reserved reference is created as refs/{name}/heads/{id} where id is a unique integer (which is also returned).

Reserve two refnames for the given commit.

Returns the names of the two reserved refs, the first pointing to the given commit and the second available for further work.

The reserved references are created as refs/{name}/heads/{id} and refs/{name}/bases/{id} where the bases reference is available to point to an object associated with the heads reference.

It is assumed that the bases refs are aligned with the heads references and not used for other purposes.

Check if a topic commit is mergeable into a target branch.

The path to the git repository.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.