本文整理汇总了C#中LibGit2Sharp.Repository.Flow方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.Flow方法的具体用法?C# Repository.Flow怎么用?C# Repository.Flow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGit2Sharp.Repository
的用法示例。
在下文中一共展示了Repository.Flow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init_FlowIsInitialized
public void Init_FlowIsInitialized()
{
using (_testRepository = new Repository(_testPath))
{
_testRepository.Flow().Init(new GitFlowRepoSettings(), author);
Assert.True(_testRepository.Flow().IsInitialized());
}
}
示例2: Feature_StartNewFeatureCreatesNewBranch
public void Feature_StartNewFeatureCreatesNewBranch()
{
using (_testRepository = new Repository(_testPath))
{
var fullBranchname = _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Feature) + "testFeature";
var newBranch = _testRepository.Branches[fullBranchname];
if (newBranch != null)
TestHelpers.DeleteBranch(_testRepository, newBranch);
Assert.Null(_testRepository.Branches[fullBranchname]);
var info = _testRepository.Flow().StartNewFeature("testFeature");
Assert.NotNull(info);
newBranch = _testRepository.Branches[fullBranchname];
Assert.NotNull(newBranch);
//TestHelpers.DeleteBranch(_testRepository,newBranch);
}
}
示例3: Feature_PublishFeatureCreatesRemote
public void Feature_PublishFeatureCreatesRemote()
{
using (_testRepository = new Repository(_testPath))
{
string branchName = TestHelpers.RandomString(8);
var fullBranchname = _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Feature) + branchName;
var newBranch = _testRepository.Branches[fullBranchname];
if (newBranch != null)
TestHelpers.DeleteBranch(_testRepository, newBranch);
var info = _testRepository.Flow().StartNewFeature(branchName);
Assert.False(_testRepository.Branches[fullBranchname].IsTracking);
_testRepository.Flow().PublishFeature(branchName);
Assert.True(_testRepository.Branches[fullBranchname].IsTracking);
//TestHelpers.DeleteBranch(_testRepository,newBranch);
}
}
示例4: Init_FlowSetsConfigToDefaultValues
public void Init_FlowSetsConfigToDefaultValues()
{
using (_testRepository = new Repository(_testPath))
{
_testRepository.Flow().Init(new GitFlowRepoSettings(), author);
//TODO Finish
Assert.Equal(
_testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Master),
GitFlowSetting.Master.GetAttribute<GitFlowConfigAttribute>().DefaultValue
);
Assert.Equal(
_testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Develop),
GitFlowSetting.Develop.GetAttribute<GitFlowConfigAttribute>().DefaultValue
);
}
}
示例5: Init_EmptyFlowCreatesBranches
public void Init_EmptyFlowCreatesBranches()
{
using (_testRepository = new Repository(_testPath))
{
_testRepository.Flow().Init(new GitFlowRepoSettings(), author);
Assert.Equal(_testRepository.Branches.Count(), 2);
Assert.NotNull(_testRepository.Branches.FirstOrDefault(
x => string.Equals(x.FriendlyName, GitFlowSetting.Master.GetAttribute<GitFlowConfigAttribute>().DefaultValue, StringComparison.OrdinalIgnoreCase)));
Assert.NotNull(_testRepository.Branches.FirstOrDefault(
x => string.Equals(x.FriendlyName, GitFlowSetting.Develop.GetAttribute<GitFlowConfigAttribute>().DefaultValue, StringComparison.OrdinalIgnoreCase)));
}
}
示例6: Init_FlowWithExistingBranches
public void Init_FlowWithExistingBranches(string masterBranch, string devBranch)
{
using (_testRepository = new Repository(_testPath))
{
var settings = new GitFlowRepoSettings();
Signature committer = author;
var opts = new CommitOptions { AllowEmptyCommit = true };
_testRepository.Commit("Initial commit", author, committer, opts);
TestHelpers.CreateLocalTestBranch(_testRepository, masterBranch, GitFlowSetting.Master, settings);
TestHelpers.CreateLocalTestBranch(_testRepository, devBranch, GitFlowSetting.Develop, settings);
_testRepository.Flow().Init(settings, author);
Assert.NotNull(_testRepository.Branches.FirstOrDefault(
x => string.Equals(x.FriendlyName, settings.GetSetting(GitFlowSetting.Master), StringComparison.OrdinalIgnoreCase)));
Assert.NotNull(_testRepository.Branches.FirstOrDefault(
x => string.Equals(x.FriendlyName, settings.GetSetting(GitFlowSetting.Develop), StringComparison.OrdinalIgnoreCase)));
}
}
示例7: Init_TestRepositoryContainsDevelopBranch
public void Init_TestRepositoryContainsDevelopBranch()
{
using (_testRepository = new Repository(_testPath))
{
_testRepository.Flow().Init(new GitFlowRepoSettings(), author);
Assert.NotNull(_testRepository.Branches[ _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Develop)]);
}
}
示例8: Init_TestPrefixIsSet
public void Init_TestPrefixIsSet()
{
using (_testRepository = new Repository(_testPath))
{
_testRepository.Flow().Init(new GitFlowRepoSettings(), author);
var prefix = _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Develop);
Assert.NotNull(prefix);
Assert.NotEmpty(prefix);
}
}