diff --git a/Cargo.toml b/Cargo.toml index bf87dcd..38505d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,5 @@ [workspace] members = [ - "git-ref-format", "git-commit", "git-storage", "git-trailers", diff --git a/git-storage/Cargo.toml b/git-storage/Cargo.toml index 6af3f9f..11d1f49 100644 --- a/git-storage/Cargo.toml +++ b/git-storage/Cargo.toml @@ -17,9 +17,6 @@ version = "0.16.1" default-features = false features = ["vendored-libgit2"] -[dependencies.git-ref-format] -path = "../git-ref-format" - [dependencies.libgit2-sys] version = ">= 0.14.2" default-features = false diff --git a/git-storage/src/backend/read.rs b/git-storage/src/backend/read.rs index d1257ed..2148da8 100644 --- a/git-storage/src/backend/read.rs +++ b/git-storage/src/backend/read.rs @@ -5,7 +5,7 @@ use std::{fmt, path::Path}; -use git_ext::{error::is_not_found_err, Oid}; +use git_ext::{error::is_not_found_err, ref_format, Oid}; use std_ext::result::ResultExt as _; use crate::{ @@ -89,7 +89,7 @@ impl<'a> refdb::Read for &'a Read { fn find_reference(&self, reference: Ref) -> Result, Self::FindRef> where - Ref: AsRef, + Ref: AsRef, { let reference = self .raw @@ -101,7 +101,7 @@ impl<'a> refdb::Read for &'a Read { fn find_references(&self, reference: Pat) -> Result where - Pat: AsRef, + Pat: AsRef, { Ok(References { inner: ReferencesGlob { @@ -113,7 +113,7 @@ impl<'a> refdb::Read for &'a Read { fn find_reference_oid(&self, reference: Ref) -> Result, Self::FindRefOid> where - Ref: AsRef, + Ref: AsRef, { self.raw .refname_to_id(reference.as_ref().as_str()) diff --git a/git-storage/src/backend/write.rs b/git-storage/src/backend/write.rs index 84e01c1..58f0910 100644 --- a/git-storage/src/backend/write.rs +++ b/git-storage/src/backend/write.rs @@ -7,8 +7,11 @@ use std::path::Path; use either::Either; -use git_ext::{error::is_not_found_err, Oid}; -use git_ref_format::{Qualified, RefStr, RefString}; +use git_ext::{ + error::is_not_found_err, + ref_format::{self, Qualified, RefStr, RefString}, + Oid, +}; use crate::{ odb, @@ -103,21 +106,21 @@ impl<'a> refdb::Read for &'a Write { fn find_reference(&self, reference: Ref) -> Result, Self::FindRef> where - Ref: AsRef, + Ref: AsRef, { self.read_only().find_reference(reference) } fn find_references(&self, reference: Pat) -> Result where - Pat: AsRef, + Pat: AsRef, { self.read_only().find_references(reference) } fn find_reference_oid(&self, reference: Ref) -> Result, Self::FindRefOid> where - Ref: AsRef, + Ref: AsRef, { self.read_only().find_reference_oid(reference) } diff --git a/git-storage/src/glob.rs b/git-storage/src/glob.rs index b58fcc5..afcf66a 100644 --- a/git-storage/src/glob.rs +++ b/git-storage/src/glob.rs @@ -5,7 +5,7 @@ use std::path::Path; -use git_ref_format::refspec::PatternString; +use git_ext::ref_format::refspec::PatternString; pub trait Pattern { fn matches>(&self, path: P) -> bool; diff --git a/git-storage/src/odb/write.rs b/git-storage/src/odb/write.rs index 1988f9a..1b053c0 100644 --- a/git-storage/src/odb/write.rs +++ b/git-storage/src/odb/write.rs @@ -3,8 +3,7 @@ use std::error::Error; -use git_ext::Oid; -use git_ref_format::RefStr; +use git_ext::{ref_format::RefStr, Oid}; use super::{Commit, Object, Read, Tree, TreeBuilder}; diff --git a/git-storage/src/refdb.rs b/git-storage/src/refdb.rs index cdb01ec..86f45d3 100644 --- a/git-storage/src/refdb.rs +++ b/git-storage/src/refdb.rs @@ -19,8 +19,7 @@ use std::fmt::Debug; -use git_ext::Oid; -use git_ref_format::RefString; +use git_ext::{ref_format::RefString, Oid}; pub mod iter; pub use iter::{References, ReferencesGlob}; @@ -104,7 +103,7 @@ pub mod error { #[error("reference name did contain valid UTF-8 bytes")] InvalidUtf8, #[error(transparent)] - RefString(#[from] git_ref_format::Error), + RefString(#[from] radicle_git_ext::ref_format::Error), } #[derive(Debug, Error)] diff --git a/git-storage/src/refdb/read.rs b/git-storage/src/refdb/read.rs index 698f65b..71e674a 100644 --- a/git-storage/src/refdb/read.rs +++ b/git-storage/src/refdb/read.rs @@ -3,8 +3,10 @@ use std::error::Error; -use git_ext::Oid; -use git_ref_format::{refspec, RefStr}; +use git_ext::{ + ref_format::{refspec, RefStr}, + Oid, +}; use super::Reference; diff --git a/git-storage/src/refdb/write.rs b/git-storage/src/refdb/write.rs index adfd689..249b841 100644 --- a/git-storage/src/refdb/write.rs +++ b/git-storage/src/refdb/write.rs @@ -3,8 +3,10 @@ use std::error::Error; -use git_ext::Oid; -use git_ref_format::{Qualified, RefString}; +use git_ext::{ + ref_format::{Qualified, RefString}, + Oid, +}; use super::read::Read; diff --git a/git-storage/t/Cargo.toml b/git-storage/t/Cargo.toml index 1ac59fb..6c775b6 100644 --- a/git-storage/t/Cargo.toml +++ b/git-storage/t/Cargo.toml @@ -38,10 +38,3 @@ features = ["v4"] [dev-dependencies.radicle-git-ext-test] path = "../../radicle-git-ext/t" features = ["test"] - -[dev-dependencies.git-ref-format] -path = "../../git-ref-format" - -[dev-dependencies.git-ref-format-test] -path = "../../git-ref-format/t" -features = ["test"] diff --git a/git-storage/t/src/properties/odb.rs b/git-storage/t/src/properties/odb.rs index f33e5c4..73ccb33 100644 --- a/git-storage/t/src/properties/odb.rs +++ b/git-storage/t/src/properties/odb.rs @@ -3,12 +3,12 @@ use git2::ObjectType; -use git_ref_format::RefString; -use git_ref_format_test::gen::valid; use git_storage::{ odb::{Read as _, Write as _}, signature::UserInfo, }; +use radicle_git_ext::ref_format::RefString; +use radicle_git_ext_test::git_ref_format::gen::valid; use proptest::prelude::*; diff --git a/radicle-git-ext/Cargo.toml b/radicle-git-ext/Cargo.toml index 26d909f..a9b91ef 100644 --- a/radicle-git-ext/Cargo.toml +++ b/radicle-git-ext/Cargo.toml @@ -25,7 +25,8 @@ features = ["vendored-libgit2"] [dependencies.git-ref-format] version = "0.2.0" -path = "../git-ref-format" +path = "./git-ref-format" +features = ["macro", "serde", "minicbor"] [dependencies.serde] version = "1" diff --git a/git-ref-format/Cargo.toml b/radicle-git-ext/git-ref-format/Cargo.toml similarity index 100% rename from git-ref-format/Cargo.toml rename to radicle-git-ext/git-ref-format/Cargo.toml diff --git a/git-ref-format/core/CHANGELOG.md b/radicle-git-ext/git-ref-format/core/CHANGELOG.md similarity index 100% rename from git-ref-format/core/CHANGELOG.md rename to radicle-git-ext/git-ref-format/core/CHANGELOG.md diff --git a/git-ref-format/core/Cargo.toml b/radicle-git-ext/git-ref-format/core/Cargo.toml similarity index 100% rename from git-ref-format/core/Cargo.toml rename to radicle-git-ext/git-ref-format/core/Cargo.toml diff --git a/git-ref-format/core/src/cbor.rs b/radicle-git-ext/git-ref-format/core/src/cbor.rs similarity index 100% rename from git-ref-format/core/src/cbor.rs rename to radicle-git-ext/git-ref-format/core/src/cbor.rs diff --git a/git-ref-format/core/src/check.rs b/radicle-git-ext/git-ref-format/core/src/check.rs similarity index 100% rename from git-ref-format/core/src/check.rs rename to radicle-git-ext/git-ref-format/core/src/check.rs diff --git a/git-ref-format/core/src/deriv.rs b/radicle-git-ext/git-ref-format/core/src/deriv.rs similarity index 100% rename from git-ref-format/core/src/deriv.rs rename to radicle-git-ext/git-ref-format/core/src/deriv.rs diff --git a/git-ref-format/core/src/lib.rs b/radicle-git-ext/git-ref-format/core/src/lib.rs similarity index 100% rename from git-ref-format/core/src/lib.rs rename to radicle-git-ext/git-ref-format/core/src/lib.rs diff --git a/git-ref-format/core/src/lit.rs b/radicle-git-ext/git-ref-format/core/src/lit.rs similarity index 100% rename from git-ref-format/core/src/lit.rs rename to radicle-git-ext/git-ref-format/core/src/lit.rs diff --git a/git-ref-format/core/src/name.rs b/radicle-git-ext/git-ref-format/core/src/name.rs similarity index 100% rename from git-ref-format/core/src/name.rs rename to radicle-git-ext/git-ref-format/core/src/name.rs diff --git a/git-ref-format/core/src/name/iter.rs b/radicle-git-ext/git-ref-format/core/src/name/iter.rs similarity index 100% rename from git-ref-format/core/src/name/iter.rs rename to radicle-git-ext/git-ref-format/core/src/name/iter.rs diff --git a/git-ref-format/core/src/refspec.rs b/radicle-git-ext/git-ref-format/core/src/refspec.rs similarity index 100% rename from git-ref-format/core/src/refspec.rs rename to radicle-git-ext/git-ref-format/core/src/refspec.rs diff --git a/git-ref-format/core/src/refspec/iter.rs b/radicle-git-ext/git-ref-format/core/src/refspec/iter.rs similarity index 100% rename from git-ref-format/core/src/refspec/iter.rs rename to radicle-git-ext/git-ref-format/core/src/refspec/iter.rs diff --git a/git-ref-format/core/src/serde.rs b/radicle-git-ext/git-ref-format/core/src/serde.rs similarity index 100% rename from git-ref-format/core/src/serde.rs rename to radicle-git-ext/git-ref-format/core/src/serde.rs diff --git a/git-ref-format/macro/CHANGELOG.md b/radicle-git-ext/git-ref-format/macro/CHANGELOG.md similarity index 100% rename from git-ref-format/macro/CHANGELOG.md rename to radicle-git-ext/git-ref-format/macro/CHANGELOG.md diff --git a/git-ref-format/macro/Cargo.toml b/radicle-git-ext/git-ref-format/macro/Cargo.toml similarity index 100% rename from git-ref-format/macro/Cargo.toml rename to radicle-git-ext/git-ref-format/macro/Cargo.toml diff --git a/git-ref-format/macro/src/lib.rs b/radicle-git-ext/git-ref-format/macro/src/lib.rs similarity index 93% rename from git-ref-format/macro/src/lib.rs rename to radicle-git-ext/git-ref-format/macro/src/lib.rs index f33d4f5..393bcd2 100644 --- a/git-ref-format/macro/src/lib.rs +++ b/radicle-git-ext/git-ref-format/macro/src/lib.rs @@ -32,7 +32,7 @@ pub fn refname(input: TokenStream) -> TokenStream { let expand = quote! { unsafe { use ::std::mem::transmute; - use ::git_ref_format::RefString; + use ::radicle_git_ext::ref_format::RefString; transmute::<_, RefString>(#safe.to_owned()) } @@ -66,7 +66,7 @@ pub fn qualified(input: TokenStream) -> TokenStream { let expand = quote! { unsafe { use ::std::{borrow::Cow, mem::transmute}; - use ::git_ref_format::{Component, RefStr, RefString, Qualified}; + use ::radicle_git_ext::ref_format::{Component, RefStr, RefString, Qualified}; let inner: RefString = transmute(#safe.to_owned()); let cow: Cow<'static, RefStr> = Cow::Owned(inner); @@ -112,7 +112,7 @@ pub fn component(input: TokenStream) -> TokenStream { let expand = quote! { unsafe { use ::std::{borrow::Cow, mem::transmute}; - use ::git_ref_format::{Component, RefStr, RefString}; + use ::radicle_git_ext::ref_format::{Component, RefStr, RefString}; let inner: RefString = transmute(#safe.to_owned()); let cow: Cow<'static, RefStr> = Cow::Owned(inner); @@ -153,7 +153,7 @@ pub fn pattern(input: TokenStream) -> TokenStream { let expand = quote! { unsafe { use ::std::mem::transmute; - use ::git_ref_format::refspec::PatternString; + use ::radicle_git_ext::ref_format::refspec::PatternString; transmute::<_, PatternString>(#safe.to_owned()) } diff --git a/git-ref-format/src/lib.rs b/radicle-git-ext/git-ref-format/src/lib.rs similarity index 100% rename from git-ref-format/src/lib.rs rename to radicle-git-ext/git-ref-format/src/lib.rs diff --git a/git-ref-format/t/Cargo.toml b/radicle-git-ext/git-ref-format/t/Cargo.toml similarity index 100% rename from git-ref-format/t/Cargo.toml rename to radicle-git-ext/git-ref-format/t/Cargo.toml diff --git a/radicle-git-ext/src/lib.rs b/radicle-git-ext/src/lib.rs index 0da1ed3..33db4a3 100644 --- a/radicle-git-ext/src/lib.rs +++ b/radicle-git-ext/src/lib.rs @@ -20,3 +20,5 @@ pub use oid::*; pub use revwalk::*; pub use transport::*; pub use tree::Tree; + +pub use git_ref_format as ref_format; diff --git a/git-ref-format/t/src/lib.rs b/radicle-git-ext/t/src/git_ref_format.rs similarity index 67% rename from git-ref-format/t/src/lib.rs rename to radicle-git-ext/t/src/git_ref_format.rs index 48ad44e..aa4258a 100644 --- a/git-ref-format/t/src/lib.rs +++ b/radicle-git-ext/t/src/git_ref_format.rs @@ -1,13 +1,11 @@ // Copyright © 2022 The Radicle Link Contributors // SPDX-License-Identifier: GPL-3.0-or-later -#[cfg(test)] -#[macro_use] -extern crate assert_matches; - #[cfg(any(test, feature = "test"))] pub mod gen; + #[cfg(test)] -mod properties; +pub mod properties; + #[cfg(test)] -mod tests; +pub mod tests; diff --git a/git-ref-format/t/src/gen.rs b/radicle-git-ext/t/src/git_ref_format/gen.rs similarity index 100% rename from git-ref-format/t/src/gen.rs rename to radicle-git-ext/t/src/git_ref_format/gen.rs diff --git a/git-ref-format/t/src/properties.rs b/radicle-git-ext/t/src/git_ref_format/properties.rs similarity index 83% rename from git-ref-format/t/src/properties.rs rename to radicle-git-ext/t/src/git_ref_format/properties.rs index cc567da..f0a72ce 100644 --- a/git-ref-format/t/src/properties.rs +++ b/radicle-git-ext/t/src/git_ref_format/properties.rs @@ -1,10 +1,10 @@ // Copyright © 2022 The Radicle Link Contributors // SPDX-License-Identifier: GPL-3.0-or-later -use git_ref_format::{check_ref_format, Error, Options}; use proptest::prelude::*; +use radicle_git_ext::ref_format::{check_ref_format, Error, Options}; -use crate::gen; +use crate::git_ref_format::gen; mod name; mod pattern; diff --git a/git-ref-format/t/src/properties/name.rs b/radicle-git-ext/t/src/git_ref_format/properties/name.rs similarity index 96% rename from git-ref-format/t/src/properties/name.rs rename to radicle-git-ext/t/src/git_ref_format/properties/name.rs index 2a9b429..e0f954b 100644 --- a/git-ref-format/t/src/properties/name.rs +++ b/radicle-git-ext/t/src/git_ref_format/properties/name.rs @@ -3,11 +3,11 @@ use std::convert::TryFrom; -use git_ref_format::{name, refname, Error, RefStr, RefString}; use proptest::prelude::*; +use radicle_git_ext::ref_format::{name, refname, Error, RefStr, RefString}; use test_helpers::roundtrip; -use crate::gen; +use crate::git_ref_format::gen; proptest! { #[test] diff --git a/git-ref-format/t/src/properties/pattern.rs b/radicle-git-ext/t/src/git_ref_format/properties/pattern.rs similarity index 95% rename from git-ref-format/t/src/properties/pattern.rs rename to radicle-git-ext/t/src/git_ref_format/properties/pattern.rs index 6348af8..5ff8025 100644 --- a/git-ref-format/t/src/properties/pattern.rs +++ b/radicle-git-ext/t/src/git_ref_format/properties/pattern.rs @@ -3,11 +3,11 @@ use std::convert::TryFrom; -use git_ref_format::{refspec, Error}; use proptest::prelude::*; +use radicle_git_ext::ref_format::{refspec, Error}; use test_helpers::roundtrip; -use crate::gen; +use crate::git_ref_format::gen; proptest! { #[test] diff --git a/git-ref-format/t/src/tests.rs b/radicle-git-ext/t/src/git_ref_format/tests.rs similarity index 99% rename from git-ref-format/t/src/tests.rs rename to radicle-git-ext/t/src/git_ref_format/tests.rs index fd777ab..69be5c8 100644 --- a/git-ref-format/t/src/tests.rs +++ b/radicle-git-ext/t/src/git_ref_format/tests.rs @@ -1,7 +1,7 @@ // Copyright © 2022 The Radicle Link Contributors // SPDX-License-Identifier: GPL-3.0-or-later -use git_ref_format::{ +use radicle_git_ext::ref_format::{ component, name, qualified, diff --git a/radicle-git-ext/t/src/lib.rs b/radicle-git-ext/t/src/lib.rs index abfecf9..6ca842c 100644 --- a/radicle-git-ext/t/src/lib.rs +++ b/radicle-git-ext/t/src/lib.rs @@ -1,8 +1,14 @@ // Copyright © 2022 The Radicle Link Contributors // SPDX-License-Identifier: GPL-3.0-or-later +#[cfg(test)] +#[macro_use] +extern crate assert_matches; #[cfg(any(test, feature = "test"))] pub mod gen; #[cfg(test)] mod commit; + +#[cfg(any(test, feature = "test"))] +pub mod git_ref_format; diff --git a/radicle-surf/Cargo.toml b/radicle-surf/Cargo.toml index 4b008b5..22f327d 100644 --- a/radicle-surf/Cargo.toml +++ b/radicle-surf/Cargo.toml @@ -37,11 +37,6 @@ version = "0.16.1" default-features = false features = ["vendored-libgit2"] -[dependencies.git-ref-format] -version = "0.2.0" -path = "../git-ref-format" -features = ["macro", "serde"] - [dependencies.radicle-git-ext] version = "0.2.0" path = "../radicle-git-ext" diff --git a/radicle-surf/src/branch.rs b/radicle-surf/src/branch.rs index 10aca63..b419b09 100644 --- a/radicle-surf/src/branch.rs +++ b/radicle-surf/src/branch.rs @@ -3,7 +3,7 @@ use std::{ str::{self, FromStr}, }; -use git_ref_format::{component, lit, Component, Qualified, RefStr, RefString}; +use git_ext::ref_format::{component, lit, Component, Qualified, RefStr, RefString}; use crate::refs::refstr_join; @@ -295,7 +295,7 @@ impl FromStr for Remote { } pub mod error { - use git_ref_format::RefString; + use radicle_git_ext::ref_format::{self, RefString}; use thiserror::Error; #[derive(Debug, Error)] @@ -305,7 +305,7 @@ pub mod error { #[error("the refname '{0}' did not begin with 'refs/heads' or 'refs/remotes'")] NotQualified(String), #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] std::str::Utf8Error), } @@ -317,7 +317,7 @@ pub mod error { #[error("the refname '{0}' did not begin with 'refs/heads'")] NotQualified(String), #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] std::str::Utf8Error), } @@ -329,7 +329,7 @@ pub mod error { #[error("the refname '{0}' did not begin with 'refs/remotes'")] NotRemotes(RefString), #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] std::str::Utf8Error), } diff --git a/radicle-surf/src/error.rs b/radicle-surf/src/error.rs index 7bd5954..5aef469 100644 --- a/radicle-surf/src/error.rs +++ b/radicle-surf/src/error.rs @@ -44,7 +44,7 @@ pub enum Error { #[error(transparent)] Namespace(#[from] namespace::Error), #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] git_ext::ref_format::Error), #[error(transparent)] Revision(Box), #[error(transparent)] diff --git a/radicle-surf/src/glob.rs b/radicle-surf/src/glob.rs index f06e36c..69bbbb7 100644 --- a/radicle-surf/src/glob.rs +++ b/radicle-surf/src/glob.rs @@ -17,7 +17,8 @@ use std::marker::PhantomData; -use git_ref_format::{ +use git_ext::ref_format::{ + self, refname, refspec::{self, PatternString, QualifiedPattern}, Qualified, @@ -31,7 +32,7 @@ use crate::{Branch, Local, Namespace, Remote, Tag}; #[derive(Debug, Error)] pub enum Error { #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), } /// A collection of globs for a git reference type. diff --git a/radicle-surf/src/lib.rs b/radicle-surf/src/lib.rs index 8b3b5bd..675f812 100644 --- a/radicle-surf/src/lib.rs +++ b/radicle-surf/src/lib.rs @@ -32,8 +32,10 @@ //! //! [serde]: https://crates.io/crates/serde +extern crate radicle_git_ext as git_ext; + /// Re-exports. -pub use git_ref_format; +pub use radicle_git_ext::ref_format; /// Represents an object id in Git. Re-exported from `radicle-git-ext`. pub type Oid = radicle_git_ext::Oid; diff --git a/radicle-surf/src/namespace.rs b/radicle-surf/src/namespace.rs index 3ced7d5..fe75b52 100644 --- a/radicle-surf/src/namespace.rs +++ b/radicle-surf/src/namespace.rs @@ -21,7 +21,8 @@ use std::{ str::{self, FromStr}, }; -use git_ref_format::{ +use git_ext::ref_format::{ + self, refspec::{NamespacedPattern, PatternString, QualifiedPattern}, Component, Namespaced, @@ -30,7 +31,6 @@ use git_ref_format::{ RefString, }; use nonempty::NonEmpty; -pub use radicle_git_ext::Oid; use thiserror::Error; #[derive(Debug, Error)] @@ -40,7 +40,7 @@ pub enum Error { #[error("namespaces must not be empty")] EmptyNamespace, #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] str::Utf8Error), } diff --git a/radicle-surf/src/refs.rs b/radicle-surf/src/refs.rs index 2f9f9f8..2a11b6d 100644 --- a/radicle-surf/src/refs.rs +++ b/radicle-surf/src/refs.rs @@ -6,7 +6,7 @@ use std::{ convert::TryFrom as _, }; -use git_ref_format::{lit, name::Components, Component, Qualified, RefString}; +use git_ext::ref_format::{self, lit, name::Components, Component, Qualified, RefString}; use crate::{tag, Branch, Namespace, Tag}; @@ -187,7 +187,7 @@ impl<'a> Iterator for Categories<'a> { Some(res) => { return Some(res.map_err(error::Category::from).and_then(|r| { let name = std::str::from_utf8(r.name_bytes())?; - let name = git_ref_format::RefStr::try_from_str(name)?; + let name = ref_format::RefStr::try_from_str(name)?; let name = name.qualified().ok_or_else(|| { error::Category::NotQualified(name.to_ref_string()) })?; @@ -207,7 +207,7 @@ impl<'a> Iterator for Categories<'a> { pub mod error { use std::str; - use git_ref_format::RefString; + use radicle_git_ext::ref_format::{self, RefString}; use thiserror::Error; use crate::{branch, tag}; @@ -227,7 +227,7 @@ pub mod error { #[error("the reference '{0}' was expected to be qualified, i.e. 'refs//'")] NotQualified(RefString), #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] str::Utf8Error), } diff --git a/radicle-surf/src/repo.rs b/radicle-surf/src/repo.rs index c6557a8..8a1fc37 100644 --- a/radicle-surf/src/repo.rs +++ b/radicle-surf/src/repo.rs @@ -22,8 +22,10 @@ use std::{ str, }; -use git_ref_format::{refspec::QualifiedPattern, Qualified, RefStr, RefString}; -use radicle_git_ext::Oid; +use git_ext::{ + ref_format::{refspec::QualifiedPattern, Qualified, RefStr, RefString}, + Oid, +}; use crate::{ blob::{Blob, BlobRef}, diff --git a/radicle-surf/src/revision.rs b/radicle-surf/src/revision.rs index 594f9f8..08826a6 100644 --- a/radicle-surf/src/revision.rs +++ b/radicle-surf/src/revision.rs @@ -17,8 +17,10 @@ use std::{convert::Infallible, str::FromStr}; -use git_ref_format::{Qualified, RefString}; -use radicle_git_ext::Oid; +use git_ext::{ + ref_format::{Qualified, RefString}, + Oid, +}; use crate::{Branch, Commit, Error, Repository, Tag}; diff --git a/radicle-surf/src/tag.rs b/radicle-surf/src/tag.rs index 1319933..fe2a6cb 100644 --- a/radicle-surf/src/tag.rs +++ b/radicle-surf/src/tag.rs @@ -1,7 +1,9 @@ use std::{convert::TryFrom, str}; -use git_ref_format::{component, lit, Qualified, RefStr, RefString}; -use radicle_git_ext::Oid; +use git_ext::{ + ref_format::{component, lit, Qualified, RefStr, RefString}, + Oid, +}; use crate::{refs::refstr_join, Author}; @@ -60,13 +62,13 @@ impl Tag { pub mod error { use std::str; - use git_ref_format::RefString; + use radicle_git_ext::ref_format::{self, RefString}; use thiserror::Error; #[derive(Debug, Error)] pub enum FromTag { #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] str::Utf8Error), } @@ -82,7 +84,7 @@ pub mod error { #[error("the refname '{0}' did not begin with 'refs/tags'")] NotTag(RefString), #[error(transparent)] - RefFormat(#[from] git_ref_format::Error), + RefFormat(#[from] ref_format::Error), #[error(transparent)] Utf8(#[from] str::Utf8Error), } diff --git a/radicle-surf/t/Cargo.toml b/radicle-surf/t/Cargo.toml index 11c475b..81e88e7 100644 --- a/radicle-surf/t/Cargo.toml +++ b/radicle-surf/t/Cargo.toml @@ -23,17 +23,13 @@ version = "0.16.1" default-features = false features = ["vendored-libgit2"] -[dev-dependencies.git-ref-format] -path = "../../git-ref-format" -features = ["macro"] - -[dev-dependencies.git-ref-format-test] -path = "../../git-ref-format/t" -features = ["test"] - [dev-dependencies.radicle-git-ext] path = "../../radicle-git-ext" +[dev-dependencies.radicle-git-ext-test] +path = "../../radicle-git-ext/t" +features = ["test"] + [dev-dependencies.radicle-surf] path = ".." features = ["serde"] diff --git a/radicle-surf/t/src/branch.rs b/radicle-surf/t/src/branch.rs index f1feef2..ae4e62d 100644 --- a/radicle-surf/t/src/branch.rs +++ b/radicle-surf/t/src/branch.rs @@ -1,9 +1,8 @@ -use git_ref_format::{RefStr, RefString}; -use git_ref_format_test::gen; use proptest::prelude::*; -use test_helpers::roundtrip; - +use radicle_git_ext::ref_format::{RefStr, RefString}; +use radicle_git_ext_test::git_ref_format::gen; use radicle_surf::Branch; +use test_helpers::roundtrip; proptest! { #[test] diff --git a/radicle-surf/t/src/code_browsing.rs b/radicle-surf/t/src/code_browsing.rs index 2402f36..1d9885f 100644 --- a/radicle-surf/t/src/code_browsing.rs +++ b/radicle-surf/t/src/code_browsing.rs @@ -1,6 +1,6 @@ use std::path::Path; -use git_ref_format::refname; +use radicle_git_ext::ref_format::refname; use radicle_surf::{ fs::{self, Directory}, Branch, diff --git a/radicle-surf/t/src/diff.rs b/radicle-surf/t/src/diff.rs index 910b94a..9922e0a 100644 --- a/radicle-surf/t/src/diff.rs +++ b/radicle-surf/t/src/diff.rs @@ -1,6 +1,5 @@ -use git_ref_format::refname; use pretty_assertions::assert_eq; -use radicle_git_ext::Oid; +use radicle_git_ext::{ref_format::refname, Oid}; use radicle_surf::{ diff::{ Added, diff --git a/radicle-surf/t/src/file_system.rs b/radicle-surf/t/src/file_system.rs index d4885d2..99d0424 100644 --- a/radicle-surf/t/src/file_system.rs +++ b/radicle-surf/t/src/file_system.rs @@ -4,7 +4,7 @@ //! Unit tests for radicle_surf::file_system mod directory { - use git_ref_format::refname; + use radicle_git_ext::ref_format::refname; use radicle_surf::{ fs::{self, Entry}, Branch, diff --git a/radicle-surf/t/src/last_commit.rs b/radicle-surf/t/src/last_commit.rs index 835b956..2ab34a5 100644 --- a/radicle-surf/t/src/last_commit.rs +++ b/radicle-surf/t/src/last_commit.rs @@ -1,7 +1,6 @@ use std::{path::PathBuf, str::FromStr}; -use git_ref_format::refname; -use radicle_git_ext::Oid; +use radicle_git_ext::{ref_format::refname, Oid}; use radicle_surf::{Branch, Repository}; use super::GIT_PLATINUM; diff --git a/radicle-surf/t/src/namespace.rs b/radicle-surf/t/src/namespace.rs index 0fb8969..6eefde1 100644 --- a/radicle-surf/t/src/namespace.rs +++ b/radicle-surf/t/src/namespace.rs @@ -1,5 +1,5 @@ -use git_ref_format::{name::component, refname, refspec}; use pretty_assertions::{assert_eq, assert_ne}; +use radicle_git_ext::ref_format::{name::component, refname, refspec}; use radicle_surf::{Branch, Error, Glob, Repository}; use super::GIT_PLATINUM; diff --git a/radicle-surf/t/src/reference.rs b/radicle-surf/t/src/reference.rs index c4dfcd4..6625feb 100644 --- a/radicle-surf/t/src/reference.rs +++ b/radicle-surf/t/src/reference.rs @@ -1,4 +1,4 @@ -use git_ref_format::refspec; +use radicle_git_ext::ref_format::refspec; use radicle_surf::{Glob, Repository}; use super::GIT_PLATINUM; diff --git a/radicle-surf/t/src/rev.rs b/radicle-surf/t/src/rev.rs index 37d0bd3..ff9799f 100644 --- a/radicle-surf/t/src/rev.rs +++ b/radicle-surf/t/src/rev.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use git_ref_format::{name::component, refname}; +use radicle_git_ext::ref_format::{name::component, refname}; use radicle_surf::{Branch, Error, Oid, Repository}; use super::GIT_PLATINUM; diff --git a/radicle-surf/t/src/source.rs b/radicle-surf/t/src/source.rs index 9d28e46..7bd4ab0 100644 --- a/radicle-surf/t/src/source.rs +++ b/radicle-surf/t/src/source.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use git_ref_format::refname; +use radicle_git_ext::ref_format::refname; use radicle_surf::{Branch, Glob, Repository}; use serde_json::json; diff --git a/radicle-surf/t/src/submodule.rs b/radicle-surf/t/src/submodule.rs index 5cfbbb7..f49abe1 100644 --- a/radicle-surf/t/src/submodule.rs +++ b/radicle-surf/t/src/submodule.rs @@ -2,7 +2,7 @@ #[test] // An issue with submodules, see: https://github.com/radicle-dev/radicle-surf/issues/54 fn test_submodule_failure() { - use git_ref_format::refname; + use radicle_git_ext::ref_format::refname; use radicle_surf::{Branch, Repository}; let repo = Repository::discover(".").unwrap(); diff --git a/radicle-surf/t/src/threading.rs b/radicle-surf/t/src/threading.rs index 0b39dfc..47cca48 100644 --- a/radicle-surf/t/src/threading.rs +++ b/radicle-surf/t/src/threading.rs @@ -1,6 +1,6 @@ use std::sync::{Mutex, MutexGuard}; -use git_ref_format::{name::component, refname}; +use radicle_git_ext::ref_format::{name::component, refname}; use radicle_surf::{Branch, Error, Glob, Repository}; use super::GIT_PLATINUM; diff --git a/test/Cargo.toml b/test/Cargo.toml index 93fa18d..70c6cab 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -19,10 +19,6 @@ features = ["test"] path = "../radicle-git-ext/t" features = ["test"] -[dev-dependencies.git-ref-format-test] -path = "../git-ref-format/t" -features = ["test"] - [dev-dependencies.git-trailers-test] path = "../git-trailers/t" features = ["test"] @@ -38,4 +34,3 @@ features = ["test"] [dev-dependencies.git-storage-test] path = "../git-storage/t" features = ["test"] -