diff --git a/README.md b/README.md index ae3ce47..2153d64 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,11 @@ This should work pretty much like git with some adaptations to be more debuggabl ## Features - [x] Cloning -- [x] Status (only for new and deleted files/folders) -- [x] Pushing updates (only deletion and addition no changes) +- [x] Status (new, deleted, modified, copied, moved) +- [x] Pushing updates (new, deleted, modified) - [x] Using a .nextsyncignore to ignore files - [ ] Pulling changes - [ ] Auth without using env variables -- [ ] Detecting local changes - [ ] Various optimisation ## Usage diff --git a/src/store/object/blob.rs b/src/store/object/blob.rs index 8d16429..79eabc8 100644 --- a/src/store/object/blob.rs +++ b/src/store/object/blob.rs @@ -12,6 +12,8 @@ use crate::utils::{path, read}; use crate::store::head; use crate::store::object::{update_dates, add_node, rm_node}; +const HASH_EMPTY: &str = "d41d8cd98f00b204e9800998ecf8427e"; + pub struct Blob { r_path: PathBuf, // relative path a_path: PathBuf, // absolute path @@ -132,6 +134,11 @@ impl Blob { } pub fn get_all_identical_blobs(&mut self) -> Vec { + // an empty file is a new file not the copy of another empty file + if self.get_file_hash() == HASH_EMPTY { + return vec![]; + } + let refs_p = self.get_file_ref(); let mut blobs: Vec = vec![]; if let Ok(lines) = read::read_lines(refs_p) {