Fix bug where files have same name but differing paths #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my vault I might have two notes with the same name, but different paths. It will try to compare the wrong files in this case, I think this is because it doesn't consider the full path on this line:
obsidian-file-diff/src/main.ts
Line 176 in ad651d8
A concrete example is I have the three files:
01 Periodics/Daily/2024/02-Feb/2024-02-07.md
01 Periodics/Daily/2024/02-Feb/2024-02-07.sync-conflict-20240208-011642-CB32Q7V.md
04 Projects/03 Personal/Climbing/Sessions/2024-02-07.md
Obviously the tool should compare the first two, but it is comparing file 2 and 3, which have nothing in common.
I fixed this by adding a check when finding the corresponding file if the paths match. I didn't test it thoroughly, but it should handle the case where the conflicts are at the top level.
PS: Thanks for the great plugin! I recently swapped to sync-thing but the conflicts drive me nuts and this makes it a little easier to deal with them.