/// <summary>Core validation to be performed on all stashed commits</summary>
        /// <param name="commit"></param>
        /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
        private void ValidateStashedCommit(RevCommit commit)
        {
            NUnit.Framework.Assert.IsNotNull(commit);
            Ref stashRef = db.GetRef(Constants.R_STASH);

            NUnit.Framework.Assert.IsNotNull(stashRef);
            NUnit.Framework.Assert.AreEqual(commit, stashRef.GetObjectId());
            NUnit.Framework.Assert.IsNotNull(commit.GetAuthorIdent());
            NUnit.Framework.Assert.AreEqual(commit.GetAuthorIdent(), commit.GetCommitterIdent
                                                ());
            NUnit.Framework.Assert.AreEqual(2, commit.ParentCount);
            // Load parents
            RevWalk walk = new RevWalk(db);

            try
            {
                foreach (RevCommit parent in commit.Parents)
                {
                    walk.ParseBody(parent);
                }
            }
            finally
            {
                walk.Release();
            }
            NUnit.Framework.Assert.AreEqual(1, commit.GetParent(1).ParentCount);
            NUnit.Framework.Assert.AreEqual(head, commit.GetParent(1).GetParent(0));
            NUnit.Framework.Assert.IsFalse(commit.Tree.Equals(head.Tree), "Head tree matches stashed commit tree"
                                           );
            NUnit.Framework.Assert.AreEqual(head, commit.GetParent(0));
            NUnit.Framework.Assert.IsFalse(commit.GetFullMessage().Equals(commit.GetParent(1)
                                                                          .GetFullMessage()));
        }
예제 #2
0
 /// <exception cref="System.IO.IOException"></exception>
 private bool Result(Candidate n)
 {
     if (n.sourceCommit != null)
     {
         revPool.ParseBody(n.sourceCommit);
     }
     currentSource = n;
     return(true);
 }
예제 #3
0
 /// <summary>Core validation to be performed on all stashed commits</summary>
 /// <param name="commit"></param>
 /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
 private void ValidateStashedCommit(RevCommit commit)
 {
     NUnit.Framework.Assert.IsNotNull(commit);
     Ref stashRef = db.GetRef(Constants.R_STASH);
     NUnit.Framework.Assert.IsNotNull(stashRef);
     NUnit.Framework.Assert.AreEqual(commit, stashRef.GetObjectId());
     NUnit.Framework.Assert.IsNotNull(commit.GetAuthorIdent());
     NUnit.Framework.Assert.AreEqual(commit.GetAuthorIdent(), commit.GetCommitterIdent
         ());
     NUnit.Framework.Assert.AreEqual(2, commit.ParentCount);
     // Load parents
     RevWalk walk = new RevWalk(db);
     try
     {
         foreach (RevCommit parent in commit.Parents)
         {
             walk.ParseBody(parent);
         }
     }
     finally
     {
         walk.Release();
     }
     NUnit.Framework.Assert.AreEqual(1, commit.GetParent(1).ParentCount);
     NUnit.Framework.Assert.AreEqual(head, commit.GetParent(1).GetParent(0));
     NUnit.Framework.Assert.IsFalse(commit.Tree.Equals(head.Tree), "Head tree matches stashed commit tree"
         );
     NUnit.Framework.Assert.AreEqual(head, commit.GetParent(0));
     NUnit.Framework.Assert.IsFalse(commit.GetFullMessage().Equals(commit.GetParent(1)
         .GetFullMessage()));
 }