本文整理汇总了C#中NGit.FromGitPath方法的典型用法代码示例。如果您正苦于以下问题:C# NGit.FromGitPath方法的具体用法?C# NGit.FromGitPath怎么用?C# NGit.FromGitPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NGit
的用法示例。
在下文中一共展示了NGit.FromGitPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDirectoryVersionInfoCore
void GetDirectoryVersionInfoCore (NGit.Repository repository, GitRevision rev, FilePath [] localPaths, HashSet<FilePath> existingFiles, HashSet<FilePath> nonVersionedMissingFiles, List<VersionInfo> versions)
{
var status = new FilteredStatus (repository, repository.ToGitPath (localPaths)).Call ();
HashSet<string> added = new HashSet<string> ();
Action<IEnumerable<string>, VersionStatus> AddFiles = delegate(IEnumerable<string> files, VersionStatus fstatus) {
foreach (string file in files) {
if (!added.Add (file))
continue;
FilePath statFile = repository.FromGitPath (file);
existingFiles.Remove (statFile.CanonicalPath);
nonVersionedMissingFiles.Remove (statFile.CanonicalPath);
versions.Add (new VersionInfo (statFile, "", false, fstatus, rev, VersionStatus.Versioned, null));
}
};
AddFiles (status.GetAdded (), VersionStatus.Versioned | VersionStatus.ScheduledAdd);
AddFiles (status.GetChanged (), VersionStatus.Versioned | VersionStatus.Modified);
AddFiles (status.GetModified (), VersionStatus.Versioned | VersionStatus.Modified);
AddFiles (status.GetRemoved (), VersionStatus.Versioned | VersionStatus.ScheduledDelete);
AddFiles (status.GetMissing (), VersionStatus.Versioned | VersionStatus.ScheduledDelete);
AddFiles (status.GetConflicting (), VersionStatus.Versioned | VersionStatus.Conflicted);
AddFiles (status.GetUntracked (), VersionStatus.Unversioned);
}