Skip to content

Commit

Permalink
hotfix: fix diffing with relative roots
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowsink committed Sep 14, 2024
1 parent 70b5929 commit c011080
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "foldiff"
authors = ["Hazel Atkinson"]
version = "0.1.0"
version = "1.0.1"
edition = "2021"
license-file = "LICENSE.md"
description = "A general purpose diffing tool that operates on folders of mixed text/binary files."
Expand Down
9 changes: 4 additions & 5 deletions src/foldiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,15 @@ impl DiffingDiff {
if ftype.is_symlink() {
bail!("Entry at '{:?}' is a symlink, bailing", entry.path());
}
// strip the root off the front of the path else we get errors
let path = entry.path();
let path = path.strip_prefix(&root)?;
if ftype.is_dir() {
// recurse
self.scan_internal(&entry.path(), new, spinner)?;
self.scan_internal(&path, new, spinner)?;
}
else {
// file found!
// strip the root off the front of the path
// else we get errors in add_file
let path = entry.path();
let path = path.strip_prefix(&root)?;
self.add_file(new, path).context("While adding file to diff")?;
}

Expand Down

0 comments on commit c011080

Please sign in to comment.