Exemplo n.º 1
0
        public virtual void Test003_lookupCompressedObject()
        {
            PackFile     pr;
            ObjectId     id;
            ObjectLoader or;

            id = ObjectId.FromString("902d5476fa249b7abc9d84c611577a81381f0327");
            pr = new PackFile(TEST_IDX, TEST_PACK);
            or = pr.Get(new WindowCursor(null), id);
            NUnit.Framework.Assert.IsNotNull(or);
            NUnit.Framework.Assert.AreEqual(Constants.OBJ_TREE, or.GetType());
            NUnit.Framework.Assert.AreEqual(35, or.GetSize());
            pr.Close();
        }
Exemplo n.º 2
0
 private void RemovePack(PackFile deadPack)
 {
     ObjectDirectory.PackList o;
     ObjectDirectory.PackList n;
     do
     {
         o = packList.Get();
         PackFile[] oldList = o.packs;
         int        j       = IndexOf(oldList, deadPack);
         if (j < 0)
         {
             break;
         }
         PackFile[] newList = new PackFile[oldList.Length - 1];
         System.Array.Copy(oldList, 0, newList, 0, j);
         System.Array.Copy(oldList, j + 1, newList, j, newList.Length - j);
         n = new ObjectDirectory.PackList(o.snapshot, newList);
     }while (!packList.CompareAndSet(o, n));
     deadPack.Close();
 }