mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-31 17:00:46 +08:00
To help with clarity and potential publishing of the crates, the full `radicle-` prefix is used for the crate names. Note that it wasn't chosen got `git-ref-format` and `git-trailers` since they are truly general libraries (bar the feature flag for link specific reference names). Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
23 lines
640 B
Rust
23 lines
640 B
Rust
// Copyright © 2019-2020 The Radicle Foundation <hello@radicle.foundation>
|
|
//
|
|
// This file is part of radicle-link, distributed under the GPLv3 with Radicle
|
|
// Linking Exception. For full terms see the included LICENSE file.
|
|
|
|
use std::{fmt::Display, io};
|
|
|
|
pub fn is_not_found_err(e: &git2::Error) -> bool {
|
|
e.code() == git2::ErrorCode::NotFound
|
|
}
|
|
|
|
pub fn is_exists_err(e: &git2::Error) -> bool {
|
|
e.code() == git2::ErrorCode::Exists
|
|
}
|
|
|
|
pub fn into_git_err<E: Display>(e: E) -> git2::Error {
|
|
git2::Error::from_str(&e.to_string())
|
|
}
|
|
|
|
pub fn into_io_err(e: git2::Error) -> io::Error {
|
|
io::Error::new(io::ErrorKind::Other, e)
|
|
}
|