92
92
NUnit.Framework.Assert.AreEqual(reflogs[2].GetNewId(), commit1.Id);
93
93
NUnit.Framework.Assert.AreEqual(reflogs[2].GetOldId(), ObjectId.ZeroId);
94
NUnit.Framework.Assert.AreEqual(reflogs[1].GetComment(), "checkout: moving from master to b1"
94
96
NUnit.Framework.Assert.AreEqual(reflogs[1].GetNewId(), commit1.Id);
95
97
NUnit.Framework.Assert.AreEqual(reflogs[1].GetOldId(), commit1.Id);
96
98
NUnit.Framework.Assert.AreEqual(reflogs[0].GetComment(), "commit: Removed file");
112
114
NUnit.Framework.Assert.AreEqual(reflogs[0].GetComment(), "commit: Removed file");
113
115
NUnit.Framework.Assert.AreEqual(reflogs[0].GetNewId(), commit2.Id);
114
116
NUnit.Framework.Assert.AreEqual(reflogs[0].GetOldId(), commit1.Id);
117
NUnit.Framework.Assert.AreEqual(reflogs[1].GetComment(), "branch: Created from commit Initial commit"
115
119
NUnit.Framework.Assert.AreEqual(reflogs[1].GetNewId(), commit1.Id);
116
120
NUnit.Framework.Assert.AreEqual(reflogs[1].GetOldId(), ObjectId.ZeroId);
123
/// <summary>Test getting the reflog for an amend commit</summary>
124
/// <exception cref="System.Exception">System.Exception</exception>
125
[NUnit.Framework.Test]
126
public virtual void TestAmendReflog()
128
RevCommit commit2a = git.Commit().SetAmend(true).SetMessage("Deleted file").Call(
130
ICollection<ReflogEntry> reflog = git.Reflog().Call();
131
NUnit.Framework.Assert.IsNotNull(reflog);
132
NUnit.Framework.Assert.AreEqual(4, reflog.Count);
133
ReflogEntry[] reflogs = Sharpen.Collections.ToArray(reflog, new ReflogEntry[reflog
135
NUnit.Framework.Assert.AreEqual(reflogs[3].GetComment(), "commit: Initial commit"
137
NUnit.Framework.Assert.AreEqual(reflogs[3].GetNewId(), commit1.Id);
138
NUnit.Framework.Assert.AreEqual(reflogs[3].GetOldId(), ObjectId.ZeroId);
139
NUnit.Framework.Assert.AreEqual(reflogs[2].GetComment(), "checkout: moving from master to b1"
141
NUnit.Framework.Assert.AreEqual(reflogs[2].GetNewId(), commit1.Id);
142
NUnit.Framework.Assert.AreEqual(reflogs[2].GetOldId(), commit1.Id);
143
NUnit.Framework.Assert.AreEqual(reflogs[1].GetComment(), "commit: Removed file");
144
NUnit.Framework.Assert.AreEqual(reflogs[1].GetNewId(), commit2.Id);
145
NUnit.Framework.Assert.AreEqual(reflogs[1].GetOldId(), commit1.Id);
146
NUnit.Framework.Assert.AreEqual(reflogs[0].GetComment(), "commit (amend): Deleted file"
148
NUnit.Framework.Assert.AreEqual(reflogs[0].GetNewId(), commit2a.Id);
149
NUnit.Framework.Assert.AreEqual(reflogs[0].GetOldId(), commit2.Id);