-
Notifications
You must be signed in to change notification settings - Fork 651
Make branch name comparison case insensitive #2261
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
Make branch name comparison case insensitive #2261
Conversation
c8f17be
to
28e9f9e
Compare
28e9f9e
to
e85f601
Compare
5689de4
to
22ee2bc
Compare
f84b065
to
a79fc31
Compare
Add IGitRepositoryCommands interface and default implementation as a mockable and testable wrapper around the static Commands class.
a79fc31
to
f3a50b6
Compare
I'm not happy how the test turned out, but it's better than nothing I guess. |
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.
I like the way you abstracted the Commands and included as part of GitRepository.
In version 6.0 I would want to move the LibGit2Sharp code into a separate class, maybe we can move it outside of the Core. And if have luck we might have 2 implementations, one with LibGit2Sharp and other with let's say Octokit
Yes, that would be ideal, @arturcic! A dependency-free Core would be awesome. |
As part of part di4 I tried to move the libgit2sharp code to IRepositoryMetadataProvider and RepositoryExtensions and added as injectable IRepository, now in the next iteration we need to create our version of IRepository interface, Branch, Commit classes, and then we can reduce the dependency of the code on Libgit2Sharp |
When the build succeeds feel free to merge it yourself. Just add the milestone to the issue you're fixing so it is included in the release notes |
Please see my comment on the original issue: I am seeing this problem in |
The error you're seeing is not related to this, @mcascone, as GitVersion is not throwing the error message you're seeing. It is libgit2 trying to create the branch |
Description
This PR introduces the
IsEquivalentTo()
extension method toSystem.String
and uses it to make branch name comparison case insensitive.Related Issue
Fixes #864.
Motivation and Context
Working on Windows with a case insensitive file system and running GitVersion in a CI/CD pipeline on Linux, the case sensitivity of Linux often cause problems that aren't discovered on Windows. This change should remedy that discrepancy.
How Has This Been Tested?
I added a poorly constructed test to provoke the issue. Not optimal, but better than nothing. 🤷♂️
Checklist: