Skip to main content

IndexSession

Trait IndexSession 

Source
pub trait IndexSession {
    // Required methods
    fn stage(&mut self, entries: &[IndexEntry]) -> Result<(), EngineError>;
    fn stage_from_worktree(
        &mut self,
        nul_paths: &[u8],
    ) -> Result<(), EngineError>;
    fn write_tree(&self) -> Result<String, EngineError>;
}
Expand description

A scratch index, alive as long as the value. Dropping it removes the temporary index file; blobs it wrote stay in the odb, unreferenced.

Required Methods§

Source

fn stage(&mut self, entries: &[IndexEntry]) -> Result<(), EngineError>

Stage a batch in one feed: quoting-proof, and one subprocess instead of one per file.

Source

fn stage_from_worktree(&mut self, nul_paths: &[u8]) -> Result<(), EngineError>

Hash each path’s CURRENT WORKTREE content into the odb and stage it, admitting new files and dropping ones deleted from the worktree.

The worktree-snapshot primitive; nothing else may call it.

Source

fn write_tree(&self) -> Result<String, EngineError>

The tree oid of the currently staged state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§