Do not move source if destination is wrong

[?]
Mar 1, 2021, 5:58 PM
PP3E3TRE43L3ASY3APURWXWOZJRW6O2GFQ6QXYHEWXDNDAKGN34QC

Dependencies

  • [2] Y7YAFMFF Fix path prefix striping on Windows.
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] YN63NUZO Sanakirja 1.0
  • [5] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way

Change contents

  • edit in pijul/src/commands/file_operations.rs at line 48
    [3.170173][3.170173:170279]()
    std::fs::rename(&source, &target)?;
    let target = std::fs::canonicalize(&target)?;
  • replacement in pijul/src/commands/file_operations.rs at line 49
    [3.170280][2.417:535](),[2.535][3.170398:170538](),[3.170398][3.170398:170538]()
    let source = source.strip_prefix(&repo_path)?;
    let target = target.strip_prefix(&repo_path)?;
    debug!("moving {:?} -> {:?}", source, target);
    txn.move_file(&source.to_string_lossy(), &target.to_string_lossy())?
    [3.170280]
    [3.170538]
    let target = std::fs::canonicalize(&target)?;
    {
    let source = source.strip_prefix(&repo_path)?;
    let target = target.strip_prefix(&repo_path)?;
    debug!("moving {:?} -> {:?}", source, target);
    txn.move_file(&source.to_string_lossy(), &target.to_string_lossy())?;
    }
    std::fs::rename(&source, &target)?;