push new dir

This commit is contained in:
grimhilt
2023-06-25 17:27:11 +02:00
parent a1aeb65600
commit b07e3062b7
7 changed files with 108 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
use std::path::Path;
use std::path::PathBuf;
use crate::services::api::ApiError;
use crate::services::upload_file::UploadFile;
use crate::store::index;
@@ -11,8 +11,8 @@ pub struct New {
}
impl PushChange for New {
fn can_push(&self, whitelist: Option<&Path>) -> PushState {
match self.flow(&self.obj, whitelist) {
fn can_push(&self, whitelist: &mut Option<PathBuf>) -> PushState {
match self.flow(&self.obj, whitelist.clone()) {
PushFlowState::Whitelisted => PushState::Valid,
PushFlowState::NotOnRemote => PushState::Valid,
PushFlowState::RemoteIsNewer => PushState::Conflict,