push deleted

This commit is contained in:
grimhilt
2023-06-24 17:00:15 +02:00
parent 675b650200
commit a1aeb65600
2 changed files with 25 additions and 48 deletions

View File

@@ -1,11 +1,10 @@
use std::path::Path;
use crate::services::api::ApiError;
use crate::services::req_props::ReqProps;
use crate::services::upload_file::UploadFile;
use crate::store::index;
use crate::store::object::add_blob;
use crate::store::object::blob;
use crate::commands::status::LocalObj;
use crate::commands::push::push_factory::{PushState, PushChange, PushFactory, PushFlowState};
use crate::commands::push::push_factory::{PushState, PushChange, PushFlowState};
pub struct New {
pub obj: LocalObj,
@@ -22,15 +21,6 @@ impl PushChange for New {
}
}
fn try_push(&self, whitelist: Option<&Path>) {
match self.can_push(whitelist) {
PushState::Valid => self.push(),
PushState::Conflict => todo!(), //download
PushState::Done => (),
PushState::Error => (),
}
}
fn push(&self) {
let obj = &self.obj;
let res = UploadFile::new()
@@ -51,9 +41,14 @@ impl PushChange for New {
}
// update tree
add_blob(&obj.path.clone(), "todo_date");
blob::add(&obj.path.clone(), "todo_date");
// remove index
index::rm_line(obj.path.to_str().unwrap());
}
// download file with .distant at the end
fn conflict(&self) {
todo!()
}
}