Skip to main content

Crate use_git_refspec

Crate use_git_refspec 

Source
Expand description

§use-git-refspec

Primitive Git refspec vocabulary for RustUse.

use-git-refspec models fetch and push refspec syntax. It can split simple [+]<source>:<destination> text, but it does not contact remotes or update refs.

§Basic usage

use use_git_refspec::{GitRefspec, RefspecMode};

let spec: GitRefspec = "+refs/heads/*:refs/remotes/origin/*".parse().expect("valid refspec");

assert_eq!(spec.mode(), RefspecMode::Force);
assert!(spec.is_wildcard());

§Scope

  • Model fetch vs push vocabulary.
  • Model optional force and wildcard refspec labels.
  • Keep remote operations out of scope.

Structs§

GitRefspec
A lightweight refspec model.
RefspecDestination
Refspec destination text.
RefspecSource
Refspec source text.

Enums§

RefspecDirection
Refspec direction vocabulary.
RefspecMode
Refspec force mode vocabulary.
RefspecParseError
Error returned while parsing refspec vocabulary.