本文整理汇总了C#中IRepository.Lookup方法的典型用法代码示例。如果您正苦于以下问题:C# IRepository.Lookup方法的具体用法?C# IRepository.Lookup怎么用?C# IRepository.Lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRepository
的用法示例。
在下文中一共展示了IRepository.Lookup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public static ReleaseDate Execute(IRepository repo, string commitSha, int calculatedPatch)
{
var c = repo.Lookup<Commit>(commitSha);
Debug.Assert(c != null);
var rd = new ReleaseDate
{
OriginalDate = c.When(),
OriginalCommitSha = c.Sha,
Date = c.When(),
CommitSha = c.Sha,
};
if (GitVersionFinder.ShouldGitHubFlowVersioningSchemeApply(repo))
{
return rd;
}
if (calculatedPatch == 0)
{
return rd;
}
var vp = new VersionOnMasterFinder().FindLatestStableTaggedCommitReachableFrom(repo, c);
var latestStable = repo.Lookup<Commit>(vp.CommitSha);
Debug.Assert(latestStable != null);
rd.OriginalDate = latestStable.When();
rd.OriginalCommitSha = vp.CommitSha;
return rd;
}
示例2: DirectReference
internal DirectReference(string canonicalName, IRepository repo, ObjectId targetId)
: base(repo, canonicalName, targetId.Sha)
{
targetBuilder = new Lazy<GitObject>(() =>
{
if (repo == null)
{
throw new InvalidOperationException("Target requires a local repository");
}
return repo.Lookup(targetId);
});
}
示例3: AssertNormalization
private static void AssertNormalization(IRepository repo, string filename, bool shouldHaveBeenNormalized, string expectedSha)
{
var sb = new StringBuilder();
sb.Append("I'm going to be dynamically processed\r\n");
sb.Append("And my line endings...\r\n");
sb.Append("...are going to be\n");
sb.Append("normalized!\r\n");
Touch(repo.Info.WorkingDirectory, filename, sb.ToString());
repo.Index.Stage(filename);
IndexEntry entry = repo.Index[filename];
Assert.NotNull(entry);
Assert.Equal(expectedSha, entry.Id.Sha);
var blob = repo.Lookup<Blob>(entry.Id);
Assert.NotNull(blob);
Assert.Equal(!shouldHaveBeenNormalized, blob.GetContentText().Contains("\r"));
}
示例4: DirectReference
internal DirectReference(string canonicalName, IRepository repo, ObjectId targetId)
: base(canonicalName, targetId.Sha)
{
targetBuilder = new Lazy<GitObject>(() => repo.Lookup(targetId));
}