Do not canonicalize paths when adding them from an ignore::walk

pmeunier
Jan 26, 2022, 9:08 AM
TVUSKAR72SYNH53MIQG4GAPX5WEPZ7G2G3D6V42VYYJNOHFSOY6AC

Dependencies

  • [2] 3J6IK4W2 Explicitly adding .pijul is now forbidden
  • [3] ZHABNS3S Canonicalize all paths
  • [4] 4OCC6D42 Recursive add
  • [5] OJZWJUF2 MUCH faster `pijul add -r`
  • [6] 4VWXL6KQ Correct handling of ignore files
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in libpijul/src/working_copy/filesystem.rs at line 285
    [2.1366][2.1366:1793](),[2.1793][3.2476:2510](),[3.2476][3.2476:2510](),[3.2510][2.1794:1901]()
    if let Ok(entry_path) = CanonicalPathBuf::canonicalize(entry.path()) {
    if let Ok(path) = entry_path.as_path().strip_prefix(&repo_path) {
    let is_dir = entry.file_type().unwrap().is_dir();
    if sender.send((path.to_path_buf(), is_dir)).is_err() {
    return ignore::WalkState::Quit;
    }
    } else {
    debug!("entry = {:?}", entry.path());
    [2.1366]
    [3.2677]
    if let Ok(path) = entry.path().strip_prefix(&repo_path) {
    let is_dir = entry.file_type().unwrap().is_dir();
    if sender.send((path.to_path_buf(), is_dir)).is_err() {
    return ignore::WalkState::Quit;
  • edit in libpijul/src/working_copy/filesystem.rs at line 290
    [3.2707]
    [2.1902]
    } else {
    debug!("entry = {:?}", entry.path());