本文整理汇总了C#中LibGit2Sharp.Repository.ResolveMergeBaseCommit方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.ResolveMergeBaseCommit方法的具体用法?C# Repository.ResolveMergeBaseCommit怎么用?C# Repository.ResolveMergeBaseCommit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGit2Sharp.Repository
的用法示例。
在下文中一共展示了Repository.ResolveMergeBaseCommit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
private static void Main(string[] args)
{
try
{
var commitIds = ParseCommitIds(args);
using (var repo = new Repository("."))
{
var mergeBaseCommit = repo.ResolveMergeBaseCommit(commitIds);
Console.WriteLine("Using " + mergeBaseCommit + " as merge base.");
var patch = repo.Diff.Compare<Patch>(mergeBaseCommit.Tree, repo.Head.Tip.Tree);
var valid = patch.Where(HasValidChangeStatus).ToList();
var specs = valid.Where(IsSpec).ToList();
var testable = valid.Where(IsTestable).ToList();
var testableClassesMissingSpecFiles = testable.Where(testablePatchEntryChange => GetPossibleSpecs(testablePatchEntryChange, specs).Count < 1).ToList();
var testableClassesPossiblyMissingSpecs = testable.Where(testablePatchEntryChange => !testableClassesMissingSpecFiles.Contains(testablePatchEntryChange) && !IsTested(testablePatchEntryChange, GetPossibleSpecs(testablePatchEntryChange, specs)));
Console.WriteLine();
Console.WriteLine("All changes");
patch.ForEach(patchEntryChanges => Console.WriteLine(patchEntryChanges.Status + " -> " + patchEntryChanges.Path));
Console.WriteLine();
Console.WriteLine("Changes with valid change status of " + string.Join(", ", ValidChangeStatuses.ToList().ConvertAll(validChangeStatus => validChangeStatus.ToString())));
valid.ForEach(patchEntryChanges => Console.WriteLine(patchEntryChanges.Status + " -> " + patchEntryChanges.Path));
Console.WriteLine();
Console.WriteLine("testable class changes");
testable.ForEach(patchEntryChanges => Console.WriteLine(patchEntryChanges.Status + " -> " + patchEntryChanges.Path));
Console.WriteLine();
Console.WriteLine("specs found");
specs.ForEach(patchEntryChanges => Console.WriteLine(patchEntryChanges.Status + " -> " + patchEntryChanges.Path));
Console.WriteLine();
Console.WriteLine("testable classes with missing specs");
testableClassesMissingSpecFiles.ForEach(patchEntryChanges => Console.WriteLine(patchEntryChanges.Status + " -> " + patchEntryChanges.Path));
Console.WriteLine();
Console.WriteLine("testable classes with possibly missing specs");
testableClassesPossiblyMissingSpecs.ForEach(patchEntryChanges => Console.WriteLine(patchEntryChanges.Status + " -> " + patchEntryChanges.Path));
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}