mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-27 23:30:34 +08:00
The idea of an owner came from radicle-link storing the signer in the storage which was needed for performing signing when writing particular rad references. The peer_id and personal identity was also stored within the monorepo config. Since git-storage is just general reading & writing of references and objects, these concepts are not necessarily needed at this level. Remove the owner from Write and remove the config module. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
20 lines
632 B
Rust
20 lines
632 B
Rust
// Copyright © 2022 The Radicle Link Contributors
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
|
pub struct UserInfo {
|
|
/// Provided `name` of the user.
|
|
pub name: String,
|
|
/// Proivded `email` of the user. Note that this does not
|
|
/// necessarily have to be an email, but will be used as the email
|
|
/// field in the [`git2::Signature`].
|
|
pub email: String,
|
|
}
|
|
|
|
impl UserInfo {
|
|
/// Obtain the [`git2::Signature`] for this `UserInfo`.
|
|
pub fn signature(&self) -> Result<git2::Signature, git2::Error> {
|
|
git2::Signature::now(&self.name, &self.email)
|
|
}
|
|
}
|