Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where files have same name but differing paths #13

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

blainelewis1
Copy link
Contributor

@blainelewis1 blainelewis1 commented Feb 8, 2024

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:

const originalFile = files.find(

A concrete example is I have the three files:

  1. 01 Periodics/Daily/2024/02-Feb/2024-02-07.md

  2. 01 Periodics/Daily/2024/02-Feb/2024-02-07.sync-conflict-20240208-011642-CB32Q7V.md

  3. 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.

@friebetill
Copy link
Owner

Thank you for your PR! I've tested it and it's working so far. I will publish a new version soon :)

@friebetill friebetill merged commit ac4ea85 into friebetill:master Feb 15, 2024
@blainelewis1 blainelewis1 deleted the patch-1 branch February 15, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants