Пример #1
0
		public virtual void TestReadOneLine()
		{
			SetupReflog("logs/refs/heads/master", oneLine);
			ReflogReader reader = new ReflogReader(db, "refs/heads/master");
			ReflogReader.Entry e = reader.GetLastEntry();
			NUnit.Framework.Assert.AreEqual(ObjectId.FromString("da85355dfc525c9f6f3927b876f379f46ccf826e"
				), e.GetOldId());
			NUnit.Framework.Assert.AreEqual(ObjectId.FromString("3e7549db262d1e836d9bf0af7e22355468f1717c"
				), e.GetNewId());
			NUnit.Framework.Assert.AreEqual("A O Thor Too", e.GetWho().GetName());
			NUnit.Framework.Assert.AreEqual("*****@*****.**", e.GetWho().GetEmailAddress());
			NUnit.Framework.Assert.AreEqual(120, e.GetWho().GetTimeZoneOffset());
			NUnit.Framework.Assert.AreEqual("2009-05-22T23:36:40", Iso(e.GetWho()));
			NUnit.Framework.Assert.AreEqual("commit: Add a toString for debugging to RemoteRefUpdate"
				, e.GetComment());
		}
Пример #2
0
        public virtual void TestReadLineWithMissingComment()
        {
            SetupReflog("logs/refs/heads/master", oneLineWithoutComment);
            ReflogReader reader = db.GetReflogReader("master");

            ReflogReader.Entry e = reader.GetLastEntry();
            NUnit.Framework.Assert.AreEqual(ObjectId.FromString("da85355dfc525c9f6f3927b876f379f46ccf826e"
                                                                ), e.GetOldId());
            NUnit.Framework.Assert.AreEqual(ObjectId.FromString("3e7549db262d1e836d9bf0af7e22355468f1717c"
                                                                ), e.GetNewId());
            NUnit.Framework.Assert.AreEqual("A O Thor Too", e.GetWho().GetName());
            NUnit.Framework.Assert.AreEqual("*****@*****.**", e.GetWho().GetEmailAddress());
            NUnit.Framework.Assert.AreEqual(120, e.GetWho().GetTimeZoneOffset());
            NUnit.Framework.Assert.AreEqual("2009-05-22T23:36:40", Iso(e.GetWho()));
            NUnit.Framework.Assert.AreEqual(string.Empty, e.GetComment());
        }
Пример #3
0
        public virtual void TestReadOneLine()
        {
            SetupReflog("logs/refs/heads/master", oneLine);
            ReflogReader reader = new ReflogReader(db, "refs/heads/master");

            ReflogReader.Entry e = reader.GetLastEntry();
            NUnit.Framework.Assert.AreEqual(ObjectId.FromString("da85355dfc525c9f6f3927b876f379f46ccf826e"
                                                                ), e.GetOldId());
            NUnit.Framework.Assert.AreEqual(ObjectId.FromString("3e7549db262d1e836d9bf0af7e22355468f1717c"
                                                                ), e.GetNewId());
            NUnit.Framework.Assert.AreEqual("A O Thor Too", e.GetWho().GetName());
            NUnit.Framework.Assert.AreEqual("*****@*****.**", e.GetWho().GetEmailAddress());
            NUnit.Framework.Assert.AreEqual(120, e.GetWho().GetTimeZoneOffset());
            NUnit.Framework.Assert.AreEqual("2009-05-22T23:36:40", Iso(e.GetWho()));
            NUnit.Framework.Assert.AreEqual("commit: Add a toString for debugging to RemoteRefUpdate"
                                            , e.GetComment());
        }
Пример #4
0
 public virtual void RefLogIncludesCommitMessage()
 {
     PersonIdent who = new PersonIdent("user", "*****@*****.**");
     DeleteTrashFile("file.txt");
     RevCommit stashed = git.StashCreate().SetPerson(who).Call();
     NUnit.Framework.Assert.IsNotNull(stashed);
     NUnit.Framework.Assert.AreEqual("content", Read(committedFile));
     ValidateStashedCommit(stashed);
     ReflogReader reader = new ReflogReader(git.GetRepository(), Constants.R_STASH);
     ReflogEntry entry = reader.GetLastEntry();
     NUnit.Framework.Assert.IsNotNull(entry);
     NUnit.Framework.Assert.AreEqual(ObjectId.ZeroId, entry.GetOldId());
     NUnit.Framework.Assert.AreEqual(stashed, entry.GetNewId());
     NUnit.Framework.Assert.AreEqual(who, entry.GetWho());
     NUnit.Framework.Assert.AreEqual(stashed.GetFullMessage(), entry.GetComment());
 }