Allow locked iPhone Git actions (#51)

This commit is contained in:
2026-08-14 17:53:48 +02:00
parent 65eb1da71c
commit cc2c30b0ef
5 changed files with 49 additions and 27 deletions

View File

@@ -313,14 +313,14 @@ impl MobileHomeProgress {
}
pub struct MobileHomeOperation {
authentication: Arc<MobileAuthentication>,
authentication: Option<Arc<MobileAuthentication>>,
control: GitOperationControl,
phase: Arc<Mutex<MobileHomePhase>>,
action: Mutex<Option<MobileHomeActionKind>>,
}
impl MobileHomeOperation {
pub fn new(authentication: Arc<MobileAuthentication>) -> Self {
pub fn new(authentication: Option<Arc<MobileAuthentication>>) -> Self {
let phase = Arc::new(Mutex::new(MobileHomePhase::Validating));
let observed = Arc::clone(&phase);
Self {
@@ -413,8 +413,13 @@ impl MobileHomeOperation {
}
let reservation = self
.authentication
.reserve_repository_operation(repository_operation(action))
.map_err(MobileHomeError::from_reservation)?;
.as_ref()
.map(|authentication| {
authentication
.reserve_repository_operation(repository_operation(action))
.map_err(MobileHomeError::from_reservation)
})
.transpose()?;
let result = operation();
drop(reservation);
result