smashwilson / merge-conflicts

Resolve git merge conflicts in Atom
https://atom.io/packages/merge-conflicts
MIT License
432 stars 42 forks source link

Normalize paths coming from git #236

Closed aroig closed 8 years ago

aroig commented 8 years ago

On windows, paths may have forward or backward slashes. git under fake unix environments in windows, like msys2, produces paths with forward slashes.

We need to normalize those paths as they come out of git, so path comparisons with atom paths (using backward slashes) work. Without this, merge-conflict fails to mark conflicts on files in subdirectories due to wrong slashes.

Additionally, it turns out that node's git-utils package wants forward slashes. So, for git-utils methods, we use relativize on paths to convert them to something git-utils likes.

This may fix #227 and #228.

I tried to test whether nodegit handles well windows paths, but atom errors out with USE_NODEGIT=1. Is nodegit available on atom 1.7.x? Would we have slash problems for windows there?

smashwilson commented 8 years ago

:+1: Excellent catch. :shipit:

smashwilson commented 8 years ago

I tried to test whether nodegit handles well windows paths, but atom errors out with USE_NODEGIT=1. Is nodegit available on atom 1.7.x? Would we have slash problems for windows there?

Interesting, I'll have to check that out. The way I'm accessing nodegit is a little... non-public, so I wouldn't be surprised if something else is going wrong :grin: Hence the feature flag. It's quite likely though.

smashwilson commented 8 years ago

Published as part of v1.4.3 :rocket: