use bstr::BStr;
use crate::{parse::Operation, Instruction};
impl Instruction<'_> {
pub fn operation(&self) -> Operation {
match self {
Instruction::Push(_) => Operation::Push,
Instruction::Fetch(_) => Operation::Fetch,
}
}
}
#[derive(PartialOrd, Ord, PartialEq, Eq, Copy, Clone, Hash, Debug)]
pub enum Push<'a> {
AllMatchingBranches {
allow_non_fast_forward: bool,
},
Delete {
ref_or_pattern: &'a BStr,
},
Matching {
src: &'a BStr,
dst: &'a BStr,
allow_non_fast_forward: bool,
},
}
#[derive(PartialOrd, Ord, PartialEq, Eq, Copy, Clone, Hash, Debug)]
pub enum Fetch<'a> {
Only {
src: &'a BStr,
},
Exclude {
src: &'a BStr,
},
AndUpdate {
src: &'a BStr,
dst: &'a BStr,
allow_non_fast_forward: bool,
},
}