Пример #1
0
 private void Create_Branch_If_It_Does_Not_Exist(TestCommitWithBranch testCommit, Repository repo)
 {
     if (Valid_Branch_Name(testCommit) &&
         Not_Master_Branch(testCommit) &&
         Branch_Does_Not_Exist(repo, testCommit))
     {
         repo.CreateBranch(_branch);
     }
 }
Пример #2
0
 private static void Checkout_Branch(TestCommitWithBranch testCommit, Repository repo)
 {
     if (Valid_Branch_Name(testCommit))
     {
         var branch = repo.Branches[testCommit.Branch];
         if (branch != null)
         {
             Commands.Checkout(repo, branch);
         }
     }
 }
Пример #3
0
 private static bool Not_Master_Branch(TestCommitWithBranch testCommit)
 {
     return(testCommit.Branch != MasterBranch);
 }
Пример #4
0
 private static bool Valid_Branch_Name(TestCommitWithBranch testCommit)
 {
     return(!string.IsNullOrEmpty(testCommit.Branch));
 }
Пример #5
0
 private static bool Branch_Does_Not_Exist(Repository repo, TestCommitWithBranch testCommit)
 {
     return(repo.Branches.All(x => x.FriendlyName != testCommit.Branch));
 }