public virtual void TestTrackingRefUpdateOnReject() { RemoteRefUpdate rru = new RemoteRefUpdate(db, "ac7e7e44c1885efb472ad54a78327d66bfc4ecef" , "refs/heads/master", false, null, null); Ref @ref = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, "refs/heads/master", ObjectId .FromString("2c349335b7f797072cf729c4f3bb0914ecb6dec9")); PushResult result = TestOneUpdateStatus(rru, @ref, RemoteRefUpdate.Status.REJECTED_NONFASTFORWARD , null); NUnit.Framework.Assert.IsTrue(result.GetTrackingRefUpdates().IsEmpty()); }
public virtual void TestTrackingRefUpdateDisabled() { RemoteRefUpdate rru = new RemoteRefUpdate(db, "2c349335b7f797072cf729c4f3bb0914ecb6dec9" , "refs/heads/master", false, null, null); Ref @ref = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, "refs/heads/master", ObjectId .FromString("ac7e7e44c1885efb472ad54a78327d66bfc4ecef")); refUpdates.AddItem(rru); advertisedRefs.AddItem(@ref); PushResult result = ExecutePush(); NUnit.Framework.Assert.IsTrue(result.GetTrackingRefUpdates().IsEmpty()); }
public virtual void TestPushResult() { RemoteRefUpdate rru = new RemoteRefUpdate(db, "2c349335b7f797072cf729c4f3bb0914ecb6dec9" , "refs/heads/master", false, "refs/remotes/test/master", null); Ref @ref = new ObjectIdRef.Unpeeled(RefStorage.LOOSE, "refs/heads/master", ObjectId .FromString("ac7e7e44c1885efb472ad54a78327d66bfc4ecef")); refUpdates.AddItem(rru); advertisedRefs.AddItem(@ref); PushResult result = ExecutePush(); NUnit.Framework.Assert.AreEqual(1, result.GetTrackingRefUpdates().Count); NUnit.Framework.Assert.AreEqual(1, result.GetAdvertisedRefs().Count); NUnit.Framework.Assert.AreEqual(1, result.GetRemoteUpdates().Count); NUnit.Framework.Assert.IsNotNull(result.GetTrackingRefUpdate("refs/remotes/test/master" )); NUnit.Framework.Assert.IsNotNull(result.GetAdvertisedRef("refs/heads/master")); NUnit.Framework.Assert.IsNotNull(result.GetRemoteUpdate("refs/heads/master")); }