本文整理汇总了C#中IRepository.GetRepositoryDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# IRepository.GetRepositoryDirectory方法的具体用法?C# IRepository.GetRepositoryDirectory怎么用?C# IRepository.GetRepositoryDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRepository
的用法示例。
在下文中一共展示了IRepository.GetRepositoryDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OverrideVersionManuallyIfNeeded
public static void OverrideVersionManuallyIfNeeded(this SemanticVersion version, IRepository repository, Config configuration)
{
var nextVersionTxtFileFinder = new NextVersionTxtFileFinder(repository.GetRepositoryDirectory(), configuration);
SemanticVersion manualNextVersion ;
if (nextVersionTxtFileFinder.TryGetNextVersion(out manualNextVersion))
{
if (manualNextVersion > version)
{
version.Major = manualNextVersion.Major;
version.Minor = manualNextVersion.Minor;
version.Patch = manualNextVersion.Patch;
}
}
}
示例2: OverrideVersionManuallyIfNeeded
public static void OverrideVersionManuallyIfNeeded(this SemanticVersion version, IRepository repository)
{
var nextVersionTxtFileFinder = new NextVersionTxtFileFinder(repository.GetRepositoryDirectory());
var manualNextVersion = nextVersionTxtFileFinder.GetNextVersion();
if (!manualNextVersion.IsEmpty())
{
if (manualNextVersion > version)
{
version.Major = manualNextVersion.Major;
version.Minor = manualNextVersion.Minor;
version.Patch = manualNextVersion.Patch;
}
}
}
示例3: GetKey
string GetKey(IRepository repo, string gitDir)
{
// Maybe using timestamp in .git/refs directory is enough?
var ticks = fileSystem.GetLastDirectoryWrite(Path.Combine(gitDir, "refs"));
var configPath = Path.Combine(repo.GetRepositoryDirectory(), "GitVersionConfig.yaml");
var configText = fileSystem.Exists(configPath) ? fileSystem.ReadAllText(configPath) : null;
var configHash = configText != null ? GetHash(configText) : null;
return string.Join(":", gitDir, repo.Head.CanonicalName, repo.Head.Tip.Sha, ticks, configHash);
}