public virtual void TestFindRemoteRefUpdatesTrackingRef() { remoteConfig.AddFetchRefSpec(new RefSpec("refs/heads/*:refs/remotes/test/*")); transport = NGit.Transport.Transport.Open(db, remoteConfig); ICollection <RemoteRefUpdate> result = transport.FindRemoteRefUpdatesFor(Sharpen.Collections .NCopies(1, new RefSpec("+refs/heads/a:refs/heads/a"))); NUnit.Framework.Assert.AreEqual(1, result.Count); TrackingRefUpdate tru = result.Iterator().Next().GetTrackingRefUpdate(); NUnit.Framework.Assert.AreEqual("refs/remotes/test/a", tru.GetLocalName()); NUnit.Framework.Assert.AreEqual("refs/heads/a", tru.GetRemoteName()); NUnit.Framework.Assert.AreEqual(db.Resolve("refs/heads/a"), tru.GetNewObjectId()); NUnit.Framework.Assert.AreEqual(ObjectId.ZeroId, tru.GetOldObjectId()); }
public virtual void TestTrackingRefUpdateEnabled() { 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(); TrackingRefUpdate tru = result.GetTrackingRefUpdate("refs/remotes/test/master"); NUnit.Framework.Assert.IsNotNull(tru); NUnit.Framework.Assert.AreEqual("refs/remotes/test/master", tru.GetLocalName()); NUnit.Framework.Assert.AreEqual(RefUpdate.Result.NEW, tru.GetResult()); }
internal virtual void Add(TrackingRefUpdate u) { updates.Put(u.GetLocalName(), u); }
internal virtual void Add(TrackingRefUpdate u) { updates.Put(u.GetLocalName(), u); }