/// <exception cref="System.IO.IOException"></exception> private bool ProcessOne(Candidate n) { RevCommit parent = n.GetParent(0); if (parent == null) { return(Split(n.GetNextCandidate(0), n)); } if (parent.Has(SEEN)) { return(false); } revPool.ParseHeaders(parent); if (Find(parent, n.sourcePath)) { if (idBuf.Equals(n.sourceBlob)) { // The common case of the file not being modified in // a simple string-of-pearls history. Blame parent. n.sourceCommit = parent; Push(n); return(false); } Candidate next = n.Create(parent, n.sourcePath); next.sourceBlob = idBuf.ToObjectId(); next.LoadText(reader); return(Split(next, n)); } if (n.sourceCommit == null) { return(Result(n)); } DiffEntry r = FindRename(parent, n.sourceCommit, n.sourcePath); if (r == null) { return(Result(n)); } if (0 == r.GetOldId().PrefixCompare(n.sourceBlob)) { // A 100% rename without any content change can also // skip directly to the parent. n.sourceCommit = parent; n.sourcePath = PathFilter.Create(r.GetOldPath()); Push(n); return(false); } Candidate next_1 = n.Create(parent, PathFilter.Create(r.GetOldPath())); next_1.sourceBlob = r.GetOldId().ToObjectId(); next_1.renameScore = r.GetScore(); next_1.LoadText(reader); return(Split(next_1, n)); }
public void testReadACK_ACKcontinue1() { ObjectId expid = ObjectId.FromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e"); MutableObjectId actid = new MutableObjectId(); actid.FromString(expid.Name); init("003aACK fcfcfb1fd94829c1a1704f894fc111d14770d34e continue\n"); Assert.AreEqual(PacketLineIn.AckNackResult.ACK_CONTINUE, pckIn.readACK(actid)); Assert.IsTrue(actid.Equals(expid)); assertEOF(); }
public void testReadACK_ACKready1() { ObjectId expid = ObjectId .FromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e"); MutableObjectId actid = new MutableObjectId(); init("0037ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e ready\n"); Assert.AreEqual(PacketLineIn.AckNackResult.ACK_READY, pckIn.readACK(actid)); Assert.IsTrue(actid.Equals(expid)); assertEOF(); }
public virtual void TestReadACK_ACKcommon1() { ObjectId expid = ObjectId.FromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e"); MutableObjectId actid = new MutableObjectId(); Init("0038ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e common\n"); NUnit.Framework.Assert.AreEqual(PacketLineIn.AckNackResult.ACK_COMMON, @in.ReadACK (actid)); NUnit.Framework.Assert.IsTrue(actid.Equals(expid)); AssertEOF(); }
public void testReadACK_ACKcontinue1() { ObjectId expid = ObjectId.FromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e"); MutableObjectId actid = new MutableObjectId(); actid.FromString(expid.Name); init("003aACK fcfcfb1fd94829c1a1704f894fc111d14770d34e continue\n"); Assert.AreEqual(PacketLineIn.AckNackResult.ACK_CONTINUE, pckIn.readACK(actid)); Assert.IsTrue(actid.Equals(expid)); assertEOF(); }