当前位置: 首页>>代码示例>>C#>>正文


C# IRepository.Lookup方法代码示例

本文整理汇总了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;
    }
开发者ID:hbre,项目名称:GitVersion,代码行数:31,代码来源:ReleaseDateFinder.cs

示例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);
            });
        }
开发者ID:PKRoma,项目名称:libgit2sharp,代码行数:13,代码来源:DirectReference.cs

示例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"));
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:22,代码来源:AttributesFixture.cs

示例4: DirectReference

 internal DirectReference(string canonicalName, IRepository repo, ObjectId targetId)
     : base(canonicalName, targetId.Sha)
 {
     targetBuilder = new Lazy<GitObject>(() => repo.Lookup(targetId));
 }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:5,代码来源:DirectReference.cs


注:本文中的IRepository.Lookup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。