Struct branchless::testing::Git[][src]

pub struct Git {
    pub repo_path: PathBuf,
    pub path_to_git: PathBuf,
}
Expand description

Wrapper around the Git executable, for testing.

Fields

repo_path: PathBuf

The path to the repository on disk. The directory itself must exist, although it might not have a .git folder in it. (Use Git::init_repo to initialize it.)

path_to_git: PathBuf

The path to the Git executable on disk. This is important since we test against multiple Git versions.

Implementations

Constructor.

Replace dynamic strings in the output, for testing purposes.

Get the PATH environment variable to use for testing.

Run a Git command.

Run a Git command.

Set up a Git repo in the directory and initialize git-branchless to work with it.

Set up a Git repo in the directory and initialize git-branchless to work with it.

Write the provided contents to the provided file in the repository root.

Commit a file with default contents. The time argument is used to set the commit timestamp, which is factored into the commit hash.

Commit a file with default contents. The time argument is used to set the commit timestamp, which is factored into the commit hash.

Detach HEAD. This is useful to call to make sure that no branch is checked out, and therefore that future commit operations don’t move any branches.

Get a git2::Repository object for this repository.

Get the version of the Git executable.

Determine if the Git executable supports the reference-transaction hook.

Resolve a file during a merge or rebase conflict with the provided contents.

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)

recently added

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.

Calls the given closure and return the result. Read more

Calls the given closure on self.

Calls the given closure on self.

Calls the given closure if condition == true.