gix_glob::search::pattern

Function strip_base_handle_recompute_basename_pos

Source
pub fn strip_base_handle_recompute_basename_pos<'a>(
    base: &BStr,
    relative_path: &'a BStr,
    basename_pos: Option<usize>,
    case: Case,
) -> Option<(&'a BStr, Option<usize>)>
Expand description

Returnrelative_path as being relative to base along with an updated basename_pos if it was set. case is respected for the comparison.

This is useful to turn repository-relative paths into paths relative to a particular search base.