示例#1
0
        public void testRemove()
        {
            global::GitSharp.Core.Ref master = newRef("refs/heads/master", ID_ONE);
            global::GitSharp.Core.Ref headU  = newRef("HEAD", "refs/heads/master");
            global::GitSharp.Core.Ref headR  = newRef("HEAD", master);

            packed   = toList(master);
            loose    = toList(headU, master);
            resolved = toList(headR);

            RefMap map = new RefMap("", packed, loose, resolved);

            Assert.IsNull(map.remove("not.a.reference"));

            Assert.AreSame(master, map.remove("refs/heads/master"));
            Assert.IsNull(map.get("refs/heads/master"));

            Assert.AreSame(headR, map.remove("HEAD"));
            Assert.IsNull(map.get("HEAD"));

            Assert.IsTrue(map.isEmpty());
        }
示例#2
0
        public void testRemove()
        {
            global::GitSharp.Core.Ref master = newRef("refs/heads/master", ID_ONE);
            global::GitSharp.Core.Ref headU = newRef("HEAD", "refs/heads/master");
            global::GitSharp.Core.Ref headR = newRef("HEAD", master);

            packed = toList(master);
            loose = toList(headU, master);
            resolved = toList(headR);

            RefMap map = new RefMap("", packed, loose, resolved);
            Assert.IsNull(map.remove("not.a.reference"));

            Assert.AreSame(master, map.remove("refs/heads/master"));
            Assert.IsNull(map.get("refs/heads/master"));

            Assert.AreSame(headR, map.remove("HEAD"));
            Assert.IsNull(map.get("HEAD"));

            Assert.IsTrue(map.isEmpty());
        }