Skip to main content

AbsorbOps

Trait AbsorbOps 

Source
pub trait AbsorbOps: GitOps {
    // Required methods
    fn staged_diff_hunks(&self) -> Result<Vec<Hunk>>;
    fn blame_lines(
        &self,
        file_path: &str,
        start: u32,
        end: u32,
    ) -> Result<Vec<BlameResult>>;
    fn is_ancestor(&self, ancestor: Oid, descendant: Oid) -> Result<bool>;
    fn create_fixup_commit(&self, target: Oid) -> Result<Oid>;
}
Expand description

Trait for absorb-specific git operations.

This trait abstracts the git operations needed for the absorb command, enabling dependency injection and testability.

Required Methods§

Source

fn staged_diff_hunks(&self) -> Result<Vec<Hunk>>

Get the staged diff as a list of hunks.

Source

fn blame_lines( &self, file_path: &str, start: u32, end: u32, ) -> Result<Vec<BlameResult>>

Query git blame for a specific line range in a file.

Source

fn is_ancestor(&self, ancestor: Oid, descendant: Oid) -> Result<bool>

Check if a commit is an ancestor of another commit.

Source

fn create_fixup_commit(&self, target: Oid) -> Result<Oid>

Create a fixup commit targeting the specified commit.

Implementors§