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§
Sourcefn staged_diff_hunks(&self) -> Result<Vec<Hunk>>
fn staged_diff_hunks(&self) -> Result<Vec<Hunk>>
Get the staged diff as a list of hunks.
Sourcefn blame_lines(
&self,
file_path: &str,
start: u32,
end: u32,
) -> Result<Vec<BlameResult>>
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.
Sourcefn is_ancestor(&self, ancestor: Oid, descendant: Oid) -> Result<bool>
fn is_ancestor(&self, ancestor: Oid, descendant: Oid) -> Result<bool>
Check if a commit is an ancestor of another commit.
Sourcefn create_fixup_commit(&self, target: Oid) -> Result<Oid>
fn create_fixup_commit(&self, target: Oid) -> Result<Oid>
Create a fixup commit targeting the specified commit.