C# Класс SimpleGitVersion.RepositoryInfo

Immutable object that can be obtained by calling RepositoryInfo.LoadFromPath(string, RepositoryInfoOptions) that describes the commit and all the CSemVer information.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
CIRelease CIReleaseInfo
CommitDateUtc System.DateTime
CommitSha string
CurrentUserName string
ExistingVersions IReadOnlyList
GitSolutionDirectory string
IsDirtyExplanations string
Options SimpleGitVersion.RepositoryInfoOptions
PossibleVersions IReadOnlyList
PossibleVersionsStrict IReadOnlyList
PreviousMaxRelease ITagCommit
PreviousRelease ITagCommit
ReleaseTagErrorLines IReadOnlyList
ReleaseTagErrorText string
ReleaseTagIsNotPossibleError bool
RepositoryError string
ValidReleaseTag ReleaseTagVersion

Открытые методы

Метод Описание
LoadFromPath ( string path, RepositoryInfoOptions>.Func optionsBuilder ) : RepositoryInfo

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder) and a function that can create a RepositoryInfoOptions from the actual Git repository path.

LoadFromPath ( string path, SimpleGitVersion.RepositoryInfoOptions options = null ) : RepositoryInfo

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder).

Приватные методы

Метод Описание
ComputeIsDirty ( Repository r, Commit commit, SimpleGitVersion.RepositoryInfoOptions options ) : string
RepositoryInfo ( ) : System
RepositoryInfo ( Repository r, SimpleGitVersion.RepositoryInfoOptions options, string gitSolutionDir ) : System
SetError ( StringBuilder errors, IReadOnlyList &lines, string &text ) : void
TryFindCommit ( SimpleGitVersion.RepositoryInfoOptions options, Repository r, Commit &commit, CIBranchVersionMode &ciVersionMode, string &branchNameForCIVersion ) : string

Описание методов

LoadFromPath() публичный статический Метод

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder) and a function that can create a RepositoryInfoOptions from the actual Git repository path.
public static LoadFromPath ( string path, RepositoryInfoOptions>.Func optionsBuilder ) : RepositoryInfo
path string The path to lookup.
optionsBuilder RepositoryInfoOptions>.Func Function that can create a from the Git working directory (the Solution folder).
Результат RepositoryInfo

LoadFromPath() публичный статический Метод

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder).
public static LoadFromPath ( string path, SimpleGitVersion.RepositoryInfoOptions options = null ) : RepositoryInfo
path string The path to lookup.
options SimpleGitVersion.RepositoryInfoOptions Optional .
Результат RepositoryInfo

Описание свойств

CIRelease публичное свойство

Gets CI informations if a CI release must be done. Not null only if we are on a branch that is enabled in RepositoryInfoOptions.Branches (either because it is the current branch or RepositoryInfoOptions.StartingBranchName specifies it), the RepositoryInfoOptions.StartingCommitSha is null or empty and there is no ValidReleaseTag on the commit.
public CIReleaseInfo,SimpleGitVersion CIRelease
Результат CIReleaseInfo

CommitDateUtc публичное свойство

The UTC date and time of the commit.
public DateTime,System CommitDateUtc
Результат System.DateTime

CommitSha публичное свойство

The Sha of the commit.
public string CommitSha
Результат string

CurrentUserName публичное свойство

The current user name.
public string CurrentUserName
Результат string

ExistingVersions публичное свойство

Gets the existing versions in the repository in ascending order. Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation.
public IReadOnlyList ExistingVersions
Результат IReadOnlyList

GitSolutionDirectory публичное свойство

Gets the solution directory: the one that contains the .git folder. Null only if RepositoryError is 'No Git repository.'. It ends with the Path.DirectorySeparatorChar.
public string GitSolutionDirectory
Результат string

IsDirtyExplanations публичное свойство

Gets detailed explanations about IsDirty.
public string IsDirtyExplanations
Результат string

Options публичное свойство

Gets the RepositoryInfoOptions that has been used.
public RepositoryInfoOptions,SimpleGitVersion Options
Результат SimpleGitVersion.RepositoryInfoOptions

PossibleVersions публичное свойство

Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation. When empty, this means that there can not be a valid release tag on the current commit point.
public IReadOnlyList PossibleVersions
Результат IReadOnlyList

PossibleVersionsStrict публичное свойство

Gets the possible versions on this commit in a strict sense: this is a subset of the PossibleVersions. A possible versions that is not a ReleaseTagVersion.IsPatch do not appear here if a greater version exists in the repository. Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation.
public IReadOnlyList PossibleVersionsStrict
Результат IReadOnlyList

PreviousMaxRelease публичное свойство

Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation. Can also be null if there is simply no previous release: the PossibleVersions are then based on ReleaseTagVersion.FirstPossibleVersions.
public ITagCommit PreviousMaxRelease
Результат ITagCommit

PreviousRelease публичное свойство

Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation. Can also be null if there is simply no previous release.
public ITagCommit PreviousRelease
Результат ITagCommit

ReleaseTagErrorLines публичное свойство

Gets the errors related to the release tags as a list of lines. Null if no errors.
public IReadOnlyList ReleaseTagErrorLines
Результат IReadOnlyList

ReleaseTagErrorText публичное свойство

Gets the errors related to the release tags as a text. Null if no errors.
public string ReleaseTagErrorText
Результат string

ReleaseTagIsNotPossibleError публичное свойство

Gets whether the error is the fact that the release tag on the current commit point is not one of the PossibleVersions. An error that describes this appears in ReleaseTagErrorLines and ReleaseTagErrorText
public bool ReleaseTagIsNotPossibleError
Результат bool

RepositoryError публичное свойство

Gets the repository level error if any: it is one line of text or null ('No Git repository.' or 'Unitialized Git repository.').
public string RepositoryError
Результат string

ValidReleaseTag публичное свойство

Gets the release tag. If there is error, this is null. It is also null if there is actually no release tag on the current commit.
public ReleaseTagVersion,SimpleGitVersion ValidReleaseTag
Результат ReleaseTagVersion