Remove `git-url` dependency
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
7b7e83fbc7
commit
6f3a598cc1
|
|
@ -197,16 +197,6 @@ dependencies = [
|
||||||
"siphasher",
|
"siphasher",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bstr"
|
|
||||||
version = "0.2.17"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
|
|
||||||
dependencies = [
|
|
||||||
"memchr",
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.11.0"
|
version = "3.11.0"
|
||||||
|
|
@ -523,19 +513,6 @@ dependencies = [
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "git-url"
|
|
||||||
version = "0.3.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d9fcc88c679f3dc55e1e4fe0324142abec612cafaafae1bf6a951c324c9d96f8"
|
|
||||||
dependencies = [
|
|
||||||
"bstr",
|
|
||||||
"home",
|
|
||||||
"quick-error",
|
|
||||||
"serde",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git2"
|
name = "git2"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
|
|
@ -592,15 +569,6 @@ dependencies = [
|
||||||
"digest 0.10.5",
|
"digest 0.10.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "home"
|
|
||||||
version = "0.5.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
|
|
||||||
dependencies = [
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http"
|
name = "http"
|
||||||
version = "0.2.8"
|
version = "0.2.8"
|
||||||
|
|
@ -1076,12 +1044,6 @@ dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "quick-error"
|
|
||||||
version = "2.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quickcheck"
|
name = "quickcheck"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
|
|
@ -1121,7 +1083,6 @@ dependencies = [
|
||||||
"ed25519-compact",
|
"ed25519-compact",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"git-ref-format",
|
"git-ref-format",
|
||||||
"git-url",
|
|
||||||
"git2",
|
"git2",
|
||||||
"log",
|
"log",
|
||||||
"multibase",
|
"multibase",
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,6 @@ pub enum Error {
|
||||||
InvalidFilterSize(usize),
|
InvalidFilterSize(usize),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
InvalidRefName(#[from] fmt::Error),
|
InvalidRefName(#[from] fmt::Error),
|
||||||
#[error("invalid git url `{url}`: {error}")]
|
|
||||||
InvalidGitUrl {
|
|
||||||
url: String,
|
|
||||||
error: git::url::parse::Error,
|
|
||||||
},
|
|
||||||
#[error("unknown address type `{0}`")]
|
#[error("unknown address type `{0}`")]
|
||||||
UnknownAddressType(u8),
|
UnknownAddressType(u8),
|
||||||
#[error("unknown message type `{0}`")]
|
#[error("unknown message type `{0}`")]
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ crossbeam-channel = { version = "0.5.6" }
|
||||||
ed25519-compact = { version = "1.0.12", features = ["pem"] }
|
ed25519-compact = { version = "1.0.12", features = ["pem"] }
|
||||||
fastrand = { version = "1.8.0" }
|
fastrand = { version = "1.8.0" }
|
||||||
git-ref-format = { version = "0", features = ["serde", "macro"] }
|
git-ref-format = { version = "0", features = ["serde", "macro"] }
|
||||||
git-url = { version = "0.3.5", features = ["serde1"] }
|
|
||||||
multibase = { version = "0.9.1" }
|
multibase = { version = "0.9.1" }
|
||||||
log = { version = "0.4.17", features = ["std"] }
|
log = { version = "0.4.17", features = ["std"] }
|
||||||
once_cell = { version = "1.13" }
|
once_cell = { version = "1.13" }
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ pub use git_ref_format as fmt;
|
||||||
pub use git_ref_format::{
|
pub use git_ref_format::{
|
||||||
lit, name, qualified, refname, Component, Namespaced, Qualified, RefStr, RefString,
|
lit, name, qualified, refname, Component, Namespaced, Qualified, RefStr, RefString,
|
||||||
};
|
};
|
||||||
pub use git_url as url;
|
|
||||||
pub use radicle_git_ext as ext;
|
pub use radicle_git_ext as ext;
|
||||||
pub use storage::git::transport::local::Url;
|
pub use storage::git::transport::local::Url;
|
||||||
pub use storage::BranchName;
|
pub use storage::BranchName;
|
||||||
|
|
@ -351,6 +350,29 @@ where
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Git URLs.
|
||||||
|
pub mod url {
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
/// A Git URL using the `file://` scheme.
|
||||||
|
pub struct File {
|
||||||
|
pub path: PathBuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl File {
|
||||||
|
/// Create a new file URL pointing to the given path.
|
||||||
|
pub fn new(path: PathBuf) -> Self {
|
||||||
|
Self { path }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ToString for File {
|
||||||
|
fn to_string(&self) -> String {
|
||||||
|
format!("file://{}", self.path.display())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Parsing and formatting of commit objects.
|
/// Parsing and formatting of commit objects.
|
||||||
/// This module exists to work with commits that have multiple signature headers.
|
/// This module exists to work with commits that have multiple signature headers.
|
||||||
pub mod commit {
|
pub mod commit {
|
||||||
|
|
|
||||||
|
|
@ -552,12 +552,9 @@ impl WriteRepository for Repository {
|
||||||
// TODO: Due to this, I think we'll have to run GC when there is a failure.
|
// TODO: Due to this, I think we'll have to run GC when there is a failure.
|
||||||
.clone_local(git2::build::CloneLocal::Local)
|
.clone_local(git2::build::CloneLocal::Local)
|
||||||
.clone(
|
.clone(
|
||||||
&git::url::Url {
|
git::url::File::new(self.backend.path().to_path_buf())
|
||||||
scheme: git::url::Scheme::File,
|
.to_string()
|
||||||
path: self.backend.path().to_string_lossy().to_string().into(),
|
.as_str(),
|
||||||
..git::url::Url::default()
|
|
||||||
}
|
|
||||||
.to_string(),
|
|
||||||
&path,
|
&path,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
@ -602,14 +599,9 @@ impl WriteRepository for Repository {
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut remote = self.backend.remote_anonymous(
|
let mut remote = self
|
||||||
&git::url::Url {
|
.backend
|
||||||
scheme: git::url::Scheme::File,
|
.remote_anonymous(git::url::File::new(staging).to_string().as_str())?;
|
||||||
path: staging.to_string_lossy().to_string().into(),
|
|
||||||
..git::url::Url::default()
|
|
||||||
}
|
|
||||||
.to_string(),
|
|
||||||
)?;
|
|
||||||
let mut opts = git2::FetchOptions::default();
|
let mut opts = git2::FetchOptions::default();
|
||||||
opts.remote_callbacks(callbacks);
|
opts.remote_callbacks(callbacks);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue