Configure iPhone Git commit identity (#76)

This commit is contained in:
2026-08-12 19:03:54 +02:00
parent e45ad07c89
commit 009db5cbcf
10 changed files with 392 additions and 37 deletions

View File

@@ -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,