本文整理汇总了C#中TreeWalk.Release方法的典型用法代码示例。如果您正苦于以下问题:C# TreeWalk.Release方法的具体用法?C# TreeWalk.Release怎么用?C# TreeWalk.Release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeWalk
的用法示例。
在下文中一共展示了TreeWalk.Release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadModulesConfig
/// <summary>
/// Load the config for this walk from
/// <code>.gitmodules</code>
/// .
/// <p>
/// Uses the root tree if
/// <see cref="SetRootTree(NGit.Treewalk.AbstractTreeIterator)">SetRootTree(NGit.Treewalk.AbstractTreeIterator)
/// </see>
/// was
/// previously called, otherwise uses the working tree.
/// <p>
/// If no submodule config is found, loads an empty config.
/// </summary>
/// <returns>this generator</returns>
/// <exception cref="System.IO.IOException">if an error occurred, or if the repository is bare
/// </exception>
/// <exception cref="NGit.Errors.ConfigInvalidException">NGit.Errors.ConfigInvalidException
/// </exception>
public virtual NGit.Submodule.SubmoduleWalk LoadModulesConfig()
{
if (rootTree == null)
{
FilePath modulesFile = new FilePath(repository.WorkTree, Constants.DOT_GIT_MODULES
);
FileBasedConfig config = new FileBasedConfig(modulesFile, repository.FileSystem);
config.Load();
modulesConfig = config;
}
else
{
TreeWalk configWalk = new TreeWalk(repository);
try
{
configWalk.AddTree(rootTree);
// The root tree may be part of the submodule walk, so we need to revert
// it after this walk.
int idx;
for (idx = 0; !rootTree.First; idx++)
{
rootTree.Back(1);
}
try
{
configWalk.Recursive = false;
PathFilter filter = PathFilter.Create(Constants.DOT_GIT_MODULES);
configWalk.Filter = filter;
while (configWalk.Next())
{
if (filter.IsDone(configWalk))
{
modulesConfig = new BlobBasedConfig(null, repository, configWalk.GetObjectId(0));
return this;
}
}
modulesConfig = new Config();
}
finally
{
if (idx > 0)
{
rootTree.Next(idx);
}
}
}
finally
{
configWalk.Release();
}
}
return this;
}