Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Failing test for case sensitive conflicts in the index #2534

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

Merged
merged 3 commits into from
Nov 12, 2015

Conversation

nulltoken
Copy link
Member

@carlosmn
Copy link
Member

I've rebased and updated this test (and fixed some copy-paste errors). The issue seems to come down to whether we consider the incoming path for a conflict to be the new correct one, like we do for git_index_add(), or just one possibility, like we do for git_index_add_bypath().

I'd be inclined to let each stage have their own capitalisation, but I'm not sure what that would mean for a case-sensitive filesystem. How can we have a conflict with different names there?

@carlosmn carlosmn force-pushed the ntk/case_index_conflicts branch from bf50a68 to 48c41d7 Compare November 12, 2015 10:58
@carlosmn
Copy link
Member

The test has been updated to the semantics I mentioned above, where git_index_conflict_add() does the same path copying as git_index_add(). /cc @ethomson @nulltoken

nulltoken and others added 3 commits November 12, 2015 12:11
When we're at offset 'i', we're dealing with the 'i+1' stage, since
conflicts start at 1.
When we insert a conflict in a case-insensitive index, accept the
new entry's path as the correct case instead of leaving the path we
already had.

This puts `git_index_conflict_add()` on the same level as
`git_index_add()` in this respect.
@carlosmn carlosmn force-pushed the ntk/case_index_conflicts branch from 48c41d7 to ad8509e Compare November 12, 2015 11:12
@ethomson
Copy link
Member

I'd be inclined to let each stage have their own capitalisation, but I'm not sure what that would mean for a case-sensitive filesystem. How can we have a conflict with different names there?

That's a good question - and you could not. However, you can git_index_conflict_add() with any three paths you want and they'll each get added... but if they're three completely different paths (or three paths differing in case on a case sensitive system) then there will be no link between them.

If you wanted to preserve some link, you could also add a record in the NAME extension... I concede that we may be able to improve things here by writing a NAME record when we think that it would be appropriate, and we can address that issue separately if we decide that we want to.

ethomson added a commit that referenced this pull request Nov 12, 2015
Failing test for case sensitive conflicts in the index
@ethomson ethomson merged commit 3f5877d into master Nov 12, 2015
@carlosmn carlosmn deleted the ntk/case_index_conflicts branch December 9, 2015 02:19
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.

3 participants