本文整理汇总了C#中LibGit2Sharp.Repository.CheckoutAllRemoteBranches方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.CheckoutAllRemoteBranches方法的具体用法?C# Repository.CheckoutAllRemoteBranches怎么用?C# Repository.CheckoutAllRemoteBranches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGit2Sharp.Repository
的用法示例。
在下文中一共展示了Repository.CheckoutAllRemoteBranches方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestLibGit2Extensions_CheckoutAllRemoteBranches
public void TestLibGit2Extensions_CheckoutAllRemoteBranches()
{
var otherRepositoryRootFolder = new DirectoryInfo(@"C:\dev1\GitReposTest\Repo3");
using (var otherRepository = new Repository(otherRepositoryRootFolder.FullName))
{
otherRepository.CheckoutAllRemoteBranches();
}
}
示例2: HandleFixedVersioning
protected virtual void HandleFixedVersioning(Dependency dependency, CloneOptions cloneOptions)
{
if (!string.IsNullOrEmpty(dependency.Branch) && !string.IsNullOrEmpty(dependency.Commit))
throw new InvalidOperationException($"Dependency {dependency}: fixed versioning: definition is incoherent: Branch = '{dependency.Branch}' != '' and Commit = '{dependency.Commit}' != '' => you can't have both set!");
if (!Directory.Exists(dependency.OutputFolder))
{
Log($"Dependency {dependency}: fixed versioning: cloning fixed branch '{dependency.Branch}' of '{dependency.Remote}' into '{dependency.OutputFolder}'...");
cloneOptions.BranchName = dependency.Branch;
Repository.Clone(dependency.Remote, dependency.OutputFolder, cloneOptions);
}
else if (Pull)
{
Log($"Dependency {dependency}: fixed versioning: repository '{dependency.Remote}' already cloned in '{dependency.OutputFolder}'");
try
{
IndentLevel++;
using (var otherRepository = new Repository(dependency.OutputFolder))
{
otherRepository.CheckoutAllRemoteBranches();
if (!string.IsNullOrEmpty(dependency.Commit))
HandleFixedVersioning_Commit(dependency, otherRepository);
else
HandleFixedVersioning_Branch(dependency, otherRepository);
}
}
finally
{
IndentLevel--;
}
}
}
示例3: HandleAutoVersioning
protected virtual void HandleAutoVersioning(Repository myRepository, string myShortName, Dependency dependency, CloneOptions cloneOptions)
{
if (!string.IsNullOrEmpty(dependency.Commit))
throw new InvalidOperationException($"Dependency {dependency}: autoversioning: definition is incoherent: Branch = '{dependency.Branch}' and a Commit = '{dependency.Commit}' => you can't have both set!");
if (Directory.Exists(dependency.OutputFolder))
{
Log($"Dependency {dependency}: autoversioning: output folder already exists: removing...");
new DirectoryInfo(dependency.OutputFolder).ForceDelete();
}
Log($"Dependency {dependency}: autoversioning: cloning default branch of '{dependency.Remote}' into '{dependency.OutputFolder}'");
Repository.Clone(dependency.Remote, dependency.OutputFolder, cloneOptions);
try
{
IndentLevel++;
using (var otherRepository = new Repository(dependency.OutputFolder))
{
otherRepository.CheckoutAllRemoteBranches();
VersionResolver.CheckoutBranchInDependencyRepository(otherRepository, myRepository, myShortName, this);
}
}
finally
{
IndentLevel--;
}
}