create IntoPathBuf

This commit is contained in:
grimhilt
2023-08-25 16:25:29 +02:00
parent d323ae3070
commit aced8b992a
6 changed files with 33 additions and 6 deletions

View File

@@ -27,6 +27,12 @@ pub fn push() {
let staged_objs = status::get_all_staged();
// exit if there is nothing to push
if staged_objs.len() == 0 {
println!("Everything up-to-date");
std::process::exit(0);
}
// path that certify that all its children can be push whithout hesistation
// (e.g. if remote dir has no changes since last sync all children
// can be pushed without verification)

View File

@@ -14,16 +14,16 @@ pub fn remote_diff() {
let (folders, files) = get_diff(relative_p);
for folder in folders {
println!("should pull {}", folder.clone().relative_s.unwrap());
println!("should pull {}", folder.clone().relative_s.unwrap());
}
for file in files {
println!("should pull {}", file.clone().relative_s.unwrap());
println!("should pull {}", file.clone().relative_s.unwrap());
}
}
pub fn get_diff(path: PathBuf) -> (Vec<ObjProps>, Vec<ObjProps>) {
let depth = "2"; // todo
let depth = "2"; // todo opti
let api_props = get_api_props();
enumerate_remote(

View File

@@ -145,7 +145,7 @@ pub fn get_all_staged() -> Vec<LocalObj> {
let mut staged_objs = vec![];
for line in lines {
let obj = Blob::new(PathBuf::from(line)).get_local_obj();
let obj = Blob::new(line).get_local_obj();
if obj.state != State::Default {
staged_objs.push(obj);
}