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

Match Git config in a mixed-sensitively way #234

Merged
merged 2 commits into from
Nov 25, 2020

Conversation

mjcheetham
Copy link
Collaborator

@mjcheetham mjcheetham commented Nov 25, 2020

Git configuration entry keys are neither case sensitive, nor in-sensitive. They are mixed sensitive.

The section and property names are NOT sensitive, but the 'scope' or inner component of the full name IS sensitive.

For example, credential.example.com.provider is the same as CREDENTIAL.example.com.PROVIDER, but credential.EXAMPLE.COM.provider is NOT.

We introduce a new StringComparer type that performs insensitive comparison on the section and property components, and sensitive comparison on the scope component.

Fixes #223

Git configuration entry keys are neither case sensitive, nor
in-sensitive. They are mixed sensitive.

The section and property names are NOT sensitive, but the 'scope' or
inner component of the full name IS sensitive.

For example, `credential.example.com.provider` is the same as
`CREDENTIAL.example.com.PROVIDER`, but `credential.EXAMPLE.COM.provider`
is NOT.

We introduce a new StringComparer type that performs insensitive
comparison on the section and property components, and sensitive
comparison on the scope component.
@mjcheetham mjcheetham marked this pull request as ready for review November 25, 2020 14:09
@mjcheetham mjcheetham added the bug A bug in Git Credential Manager label Nov 25, 2020
Add more tests to the GitConfigurationKeyComparer tests, specifically
around cases that contain no period/dots '.'.

In these cases we behave as StringComparer.Ordinal.
@mjcheetham mjcheetham merged commit f9f2ad9 into git-ecosystem:master Nov 25, 2020
@mjcheetham mjcheetham deleted the fixconfigmatching branch November 25, 2020 16:19
Copy link

@toot-gerly toot-gerly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in Git Credential Manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make gitHubAuthModes domain specific
3 participants