Skip to main content

Git

Trait Git 

Source
pub trait Git: Sync {
    // Required methods
    fn validate_branch(
        &self,
        root: &Path,
        task: &str,
        control: &Control,
    ) -> impl Future<Output = Result<(), Problem>> + Send;
    fn inspect(
        &self,
        path: &Path,
        remote: Option<&str>,
        control: &Control,
    ) -> impl Future<Output = Result<Repository, Problem>> + Send;
    fn revalidate(
        &self,
        repository: &Repository,
        control: &Control,
    ) -> impl Future<Output = Result<(), Problem>> + Send;
    fn plan(
        &self,
        repository: &Repository,
        task: &str,
        checkout: bool,
        from: Option<&str>,
        resolution: SourceResolution,
        control: &Control,
    ) -> impl Future<Output = Result<BranchPlan, Problem>> + Send;
    fn fetch(
        &self,
        repository: &Repository,
        control: &Control,
    ) -> impl Future<Output = Result<(), Problem>> + Send;
    fn add(
        &self,
        repository: &Repository,
        task: &str,
        destination: &Path,
        plan: &BranchPlan,
        control: &Control,
    ) -> impl Future<Output = Result<(), Problem>> + Send;

    // Provided method
    fn worktree_identity(
        &self,
        _path: &Path,
    ) -> impl Future<Output = Result<Option<String>, Problem>> + Send { ... }
}
Expand description

Operations used to validate repository identity, resolve branches and establish worktrees.

Required Methods§

Source

fn validate_branch( &self, root: &Path, task: &str, control: &Control, ) -> impl Future<Output = Result<(), Problem>> + Send

Ask Git to validate the task’s proposed branch name.

Source

fn inspect( &self, path: &Path, remote: Option<&str>, control: &Control, ) -> impl Future<Output = Result<Repository, Problem>> + Send

Resolve the backing repository, its identity and the selected remote.

Source

fn revalidate( &self, repository: &Repository, control: &Control, ) -> impl Future<Output = Result<(), Problem>> + Send

Check the repository against its earlier identity before proceeding.

Source

fn plan( &self, repository: &Repository, task: &str, checkout: bool, from: Option<&str>, resolution: SourceResolution, control: &Control, ) -> impl Future<Output = Result<BranchPlan, Problem>> + Send

Resolve reuse, tracking or creation of the task branch.

Source

fn fetch( &self, repository: &Repository, control: &Control, ) -> impl Future<Output = Result<(), Problem>> + Send

Refresh refs from the selected remote under Workyard’s fetch coordination.

Source

fn add( &self, repository: &Repository, task: &str, destination: &Path, plan: &BranchPlan, control: &Control, ) -> impl Future<Output = Result<(), Problem>> + Send

Create the linked worktree using the resolved branch plan.

Provided Methods§

Source

fn worktree_identity( &self, _path: &Path, ) -> impl Future<Output = Result<Option<String>, Problem>> + Send

Identity used to verify the linked worktree before applying changes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§