IRepositoryStore Interface

Summary

Provides high-level read access to a Git repository, exposing the objects and queries needed for version calculation.
Namespace
GitVersion
graph BT Type["IRepositoryStore"] class Type type-node

Syntax

public interface IRepositoryStore

Properties

Name Value Summary
Branches IBranchCollection
Gets the collection of all branches in the repository.
Head IBranch
Gets the currently checked-out branch.
Tags ITagCollection
Gets the collection of all tags in the repository.
UncommittedChangesCount int
Gets the number of files that have been modified but not yet committed.

Methods

Name Value Summary
ExcludingBranches(IEnumerable<IBranch>) IEnumerable<IBranch>
Returns all branches except those in branchesToExclude.
FindBranch(ReferenceName) IBranch
Finds and returns the branch with the given branchName, or null if not found.
FindCommitBranchesBranchedFrom(IBranch, IGitVersionConfiguration, IBranch[]) IEnumerable<BranchCommit>
Returns the commits and their originating branches that branched from branch, excluding excludedBranches.
FindMergeBase(IBranch, IBranch) ICommit
Find the merge base of the two branches, i.e. the best common ancestor of the two branches' tips.
FindMergeBase(ICommit, ICommit) ICommit
Finds the best common ancestor between commit and mainlineTip.
GetBranchesContainingCommit(ICommit, IEnumerable<IBranch>?, bool) IEnumerable<IBranch>
Returns branches that contain the given commit in their history.
GetCommitLog(ICommit, ICommit, IIgnoreConfiguration) IReadOnlyList<ICommit>
Returns the commits reachable between baseVersionSource and currentCommit, respecting ignore rules.
GetCommitsReacheableFrom(ICommit, IBranch) IReadOnlyList<ICommit>
Returns all commits reachable from commit that are also on branch.
GetCommitsReacheableFromHead(ICommit, IIgnoreConfiguration) IReadOnlyList<ICommit>
Returns all commits reachable from the HEAD commit, respecting ignore rules.
GetCurrentCommit(IBranch, string, IIgnoreConfiguration) ICommit
Returns the commit that should be treated as the current HEAD for version calculation, applying ignore rules.
GetForwardMerge(ICommit, ICommit) ICommit
Returns the commit that represents a forward merge from commitToFindCommonBase relative to findMergeBase.
GetSourceBranches(IBranch, IGitVersionConfiguration, IBranch[]) IEnumerable<IBranch>
Returns the branches that branch was directly branched from, excluding excludedBranches.
GetSourceBranches(IBranch, IGitVersionConfiguration, IEnumerable<IBranch>) IEnumerable<IBranch>
Returns the branches that branch was directly branched from, excluding the given collection of branches.
GetTargetBranch(string) IBranch
Resolves and returns the branch that matches targetBranchName, creating a local branch if necessary.
IsCommitOnBranch(ICommit, IBranch, ICommit) bool
Returns true if baseVersionSource is an ancestor of firstMatchingCommit on branch.

Extension Methods

Name Value Summary
NotNull<IRepositoryStore>(string) T
Throws ArgumentNullException when value is null; otherwise returns the value.
GitHub