use git_hash::bstr::BStr;
use git_object::immutable;
#[derive(Clone, Copy, PartialOrd, PartialEq, Ord, Eq, Hash)]
pub enum Action {
Continue,
Cancel,
Skip,
}
impl Action {
pub fn cancelled(&self) -> bool {
matches!(self, Action::Cancel)
}
}
pub trait Visit {
type PathId: Clone + Default;
fn set_current_path(&mut self, id: Self::PathId);
fn push_tracked_path_component(&mut self, component: &BStr) -> Self::PathId;
fn push_path_component(&mut self, component: &BStr);
fn pop_path_component(&mut self);
fn visit_tree(&mut self, entry: &immutable::tree::Entry<'_>) -> Action;
fn visit_nontree(&mut self, entry: &immutable::tree::Entry<'_>) -> Action;
}