Exemple #1
0
        private void RemoveTrackingRefUpdate(ObjectId want)
        {
            Iterator <TrackingRefUpdate> i = localUpdates.Iterator();

            while (i.HasNext())
            {
                TrackingRefUpdate u = i.Next();
                if (u.GetNewObjectId().Equals(want))
                {
                    i.Remove();
                }
            }
        }
Exemple #2
0
        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());
        }