本文整理汇总了C#中NGit.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# NGit.Resolve方法的具体用法?C# NGit.Resolve怎么用?C# NGit.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit
的用法示例。
在下文中一共展示了NGit.Resolve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHeadCommit
RevCommit GetHeadCommit (NGit.Repository repository)
{
RevWalk rw = new RevWalk (repository);
ObjectId headId = repository.Resolve (Constants.HEAD);
if (headId == null)
return null;
return rw.ParseCommit (headId);
}
示例2: HardReset
public static void HardReset (NGit.Repository repo, string toRef)
{
ObjectId newHead = repo.Resolve (toRef);
HardReset (repo, newHead);
}
示例3: GetChangedFiles
public static IEnumerable<Change> GetChangedFiles (NGit.Repository repo, string refRev)
{
// Get a list of files that are different in the target branch
RevWalk rw = new RevWalk (repo);
ObjectId remCommitId = repo.Resolve (refRev);
if (remCommitId == null)
return null;
RevCommit remCommit = rw.ParseCommit (remCommitId);
ObjectId headId = repo.Resolve (Constants.HEAD);
if (headId == null)
return null;
RevCommit headCommit = rw.ParseCommit (headId);
return GitUtil.CompareCommits (repo, headCommit, remCommit);
}
示例4: GetCommitChanges
/// <summary>
/// Returns a list of files that have changed in a commit
/// </summary>
public static IEnumerable<DiffEntry> GetCommitChanges (NGit.Repository repo, RevCommit commit)
{
var rev = commit.ToObjectId ();
var prev = repo.Resolve (commit.Name + "^") ?? ObjectId.ZeroId;
return CompareCommits (repo, rev, prev);
}