mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-15 16:00:35 +08:00
git-ref-format: qualified macro
Add a `qualified!` macro to the set of git-ref-format macros. This allows the construction of a `refs/<cat>/<name>` reference from a string literal. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
This commit is contained in:
@@ -1,13 +1,28 @@
|
||||
// Copyright © 2022 The Radicle Link Contributors
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
use git_ref_format::{component, name, refname, refspec, Error, Qualified, RefStr, RefString};
|
||||
use git_ref_format::{
|
||||
component,
|
||||
name,
|
||||
qualified,
|
||||
refname,
|
||||
refspec,
|
||||
Error,
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn refname_macro_works() {
|
||||
assert_eq!("refs/heads/main", refname!("refs/heads/main").as_str())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn qualified_macro_works() {
|
||||
assert_eq!("refs/heads/main", qualified!("refs/heads/main").as_str())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn component_macro_works() {
|
||||
assert_eq!("self", name::component!("self").as_str())
|
||||
|
||||
Reference in New Issue
Block a user