arxanas / scm-record

`scm-record` is a UI component to interactively select changes to include in a commit. It's meant to be embedded in source control tooling.
23 stars 9 forks source link

Fix TestFilesystem::read_dir_diff_paths #42

Closed emesterhazy closed 3 months ago

emesterhazy commented 4 months ago

This function collects the files present in the left and right directories. It should return the path suffix with the left and right prefix stripped. This is necessary because process_opts will add the left and right prefix back to the paths returned by read_dir_diff_paths. If we don't strip the prefix, we will end up with invalid paths where the prefix is duplicated.

This went unnoticed since the current tests don't diff directories. I will add a test that diffs directories in a subsequent commit.

emesterhazy commented 4 months ago

Sorry, I accidentally closed this PR's predecessor by deleting the branch on my fork.

https://github.com/arxanas/scm-record/pull/38