-
Notifications
You must be signed in to change notification settings - Fork 528
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
Probably fix #5096 #5111
Probably fix #5096 #5111
Conversation
…lly. Unfortunately, with anything `git2`, it's impossible (or unknown) to prevent it from picking up the users configuration, hence tests aren't isolated. This change alleviates the worst results of this which at least makes the tests run in my particular setup.
…hs (gitbutlerapp#5096) When testing paths for prefix-matches it's important they are all normalized in the same fashion. `canonicalize()` is very particular about canonicalizing Windows paths, which makes it easy for these paths to not be compatible to other absolute-looking paths. The difficulty here is to get the right trade-off between performance and safety, e.g. we wouldn't want these canonicalized Windows paths to be used anywhere as they are very uncommon (and don't even work everywhere).
@Byron is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
So what was the underlying issue here? The prefix match didn't work on windows due to canonicalize? |
Yes, it's very likely. Note that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I'm still not in love with the name. IIRC there was some business logic reason as to why we wanted to get the committed version of the file over the uncommitted one, but that feels like something we can bike-shed another time
When testing paths for prefix-matches it's important they are all normalized in the same fashion.
canonicalize()
is very particular about canonicalizing Windows paths, which makes it easy for these paths to not be compatible to other absolute-looking paths.The difficulty here is to get the right trade-off between performance and safety, e.g. we wouldn't want these canonicalized Windows paths to be used anywhere as they are very uncommon (and don't even work everywhere).
Notes for the Reviewer
read_file_from_workspace()
which needs work, I just did the bare minimum here. More context is here.Related to #5096 .