mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-24 05:40:38 +08:00
Port over all git relevant parts of the radicle-link repository[0]. The packages that are kept are: * git-ext * git-ref-format * git-trailers * link-git * macros * std-ext * test -- only the portions that test the above The development and testing scripts are also added for local and CI testing. [0]: https://github.com/radicle-dev/radicle-link/ Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
31 lines
818 B
Rust
31 lines
818 B
Rust
// Copyright © 2021 The Radicle Link Contributors
|
|
//
|
|
// This file is part of radicle-link, distributed under the GPLv3 with Radicle
|
|
// Linking Exception. For full terms see the included LICENSE file.
|
|
|
|
use bstr::ByteSlice as _;
|
|
use git_protocol::transport::client;
|
|
use versions::Version;
|
|
|
|
pub mod fetch;
|
|
pub mod ls;
|
|
pub mod packwriter;
|
|
pub mod take;
|
|
pub mod transport;
|
|
pub mod upload_pack;
|
|
|
|
pub use fetch::{fetch, Ref};
|
|
pub use ls::ls_refs;
|
|
pub use packwriter::PackWriter;
|
|
pub use upload_pack::upload_pack;
|
|
|
|
pub use git_hash::{oid, ObjectId};
|
|
|
|
fn remote_git_version(caps: &client::Capabilities) -> Option<Version> {
|
|
let agent = caps.capability("agent").and_then(|cap| {
|
|
cap.value()
|
|
.and_then(|bs| bs.to_str().map(|s| s.to_owned()).ok())
|
|
})?;
|
|
Version::new(agent.strip_prefix("git/")?)
|
|
}
|