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

GitRepository refactoring #2564

Merged
merged 10 commits into from
Jan 28, 2021

Conversation

arturcic
Copy link
Member

@arturcic arturcic commented Jan 26, 2021

In this PR I have moved the code from GitRepository to RepositoryMetadataProvider and GitPreparer, and kept the GitRepository as a thin layer on top of the libgit2sharp. It now exposes only the Collections of commits, branches, references, tags, the head. All the other methods were moved to RepositoryMetadataProvider and some to GitPreparer. Renamed RepositoryMetadataProvider to RepositoryStore (shorter and it's kind of a store, maybe we need a better name for this).

I also made the IGitRepository expose its properties for quering the git for needed information, and the methods that were mutating were moved to IMutatingGitRepository that extends IGitRepository. IMutatingGitRepository is used only by GitPreparer, as only this class is mutating the git repository.

The dependencies now look like:
IRepositoryStore -> IGitRepository (read only), where the IGitRepository is only exposing the collections and IRepositoryStore is actually the store

IGitPreparer -> IMutatingGitRepository (read/write) - where IMutatingGitRepository expose methods for clone, checkout, and so on.

@arturcic arturcic added this to the 5.6.5 milestone Jan 26, 2021
@arturcic arturcic enabled auto-merge (rebase) January 26, 2021 21:22
Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

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

I love this!

@arturcic arturcic merged commit 779bdd7 into GitTools:master Jan 28, 2021
@arturcic arturcic deleted the feature/gitrepository-metadata branch January 28, 2021 09:55
@github-actions
Copy link

github-actions bot commented Feb 7, 2021

🎉 This issue has been resolved in version 5.6.5 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants