Configure iPhone Git commit identity (#76)
This commit is contained in:
@@ -567,6 +567,12 @@ pub struct MobileAuthenticationState {
|
||||
pub remaining_seconds: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, uniffi::Record)]
|
||||
pub struct MobileGitIdentity {
|
||||
pub name: String,
|
||||
pub email: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)]
|
||||
pub enum MobileMutationAction {
|
||||
Move,
|
||||
@@ -1328,6 +1334,30 @@ impl MobileAuthentication {
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn git_identity(&self) -> Result<MobileGitIdentity, MobileAuthenticationFfiError> {
|
||||
self.authentication
|
||||
.git_identity()
|
||||
.map(|identity| MobileGitIdentity {
|
||||
name: identity.name().to_owned(),
|
||||
email: identity.email().to_owned(),
|
||||
})
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn set_git_identity(
|
||||
&self,
|
||||
name: String,
|
||||
email: String,
|
||||
) -> Result<MobileGitIdentity, MobileAuthenticationFfiError> {
|
||||
self.authentication
|
||||
.set_git_identity(name, email)
|
||||
.map(|identity| MobileGitIdentity {
|
||||
name: identity.name().to_owned(),
|
||||
email: identity.email().to_owned(),
|
||||
})
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn unlock_entry(
|
||||
&self,
|
||||
path: String,
|
||||
|
||||
Reference in New Issue
Block a user