Skip to main content

Crate use_git_pathspec

Crate use_git_pathspec 

Source
Expand description

§use-git-pathspec

Primitive Git pathspec vocabulary for RustUse.

use-git-pathspec models pathspec strings and common magic labels such as top, literal, glob, icase, and exclude. It does not traverse the filesystem or match paths.

§Basic usage

use use_git_pathspec::{GitPathspec, PathspecMagic};

let pathspec = GitPathspec::new(":(top,literal)README.md").expect("valid pathspec");

assert!(pathspec.has_magic(PathspecMagic::Top));
assert!(pathspec.has_magic(PathspecMagic::Literal));

§Scope

  • Wrap pathspec text and expose descriptive magic vocabulary.
  • Keep filesystem traversal and glob evaluation out of scope.

Structs§

GitPathspec
A lightweight pathspec wrapper.
PathspecPattern
A pathspec pattern string.

Enums§

PathspecMagic
Common pathspec magic labels.
PathspecParseError
Error returned while parsing pathspec vocabulary.
PathspecScope
Pathspec scope vocabulary.