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

An owned git worktree

This structure corresponds to a git_worktree in libgit2.

Implementations

Open a worktree of a the repository

If a repository is not the main tree but a worktree, this function will look up the worktree inside the parent repository and create a new git_worktree structure.

Retrieves the name of the worktree

This is the name that can be passed to repo::Repository::find_worktree to reopen the worktree. This is also the name that would appear in the list returned by repo::Repository::worktrees

Retrieves the path to the worktree

This is the path to the top-level of the source and not the path to the .git file within the worktree. This path can be passed to repo::Repository::open.

Validates the worktree

This checks that it still exists on the filesystem and that the metadata is correct

Locks the worktree

Unlocks the worktree

Checks if worktree is locked

Prunes the worktree

Checks if the worktree is prunable

Trait Implementations

Executes the destructor for this type. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.