Struct branchless::testing::Git [−][src]
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Git
impl UnwindSafe for Git
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Calls the given closure and return the result. Read more
Calls the given closure on self
.