mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-25 22:30:35 +08:00
git-ref-format: add well-known refspec components
Add constants for well-known refspec component names. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -16,7 +16,7 @@ use thiserror::Error;
|
||||
use crate::{check, lit, RefStr, RefString};
|
||||
|
||||
mod iter;
|
||||
pub use iter::{Component, Components, Iter};
|
||||
pub use iter::{component, Component, Components, Iter};
|
||||
|
||||
pub const STAR: &PatternStr = PatternStr::from_str("*");
|
||||
|
||||
|
||||
@@ -85,3 +85,19 @@ impl<'a> From<&'a PatternStr> for Components<'a> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod component {
|
||||
use super::Component;
|
||||
use crate::name;
|
||||
|
||||
pub const STAR: Component = Component::Glob(None);
|
||||
pub const HEADS: Component = Component::Normal(name::HEADS);
|
||||
pub const MAIN: Component = Component::Normal(name::MAIN);
|
||||
pub const MASTER: Component = Component::Normal(name::MASTER);
|
||||
pub const NAMESPACES: Component = Component::Normal(name::NAMESPACES);
|
||||
pub const NOTES: Component = Component::Normal(name::NOTES);
|
||||
pub const ORIGIN: Component = Component::Normal(name::ORIGIN);
|
||||
pub const REFS: Component = Component::Normal(name::REFS);
|
||||
pub const REMOTES: Component = Component::Normal(name::REMOTES);
|
||||
pub const TAGS: Component = Component::Normal(name::TAGS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user