Allow locked iPhone Git actions (#51)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user