Exemplo n.º 1
0
        public void testFindOnEmpty()
        {
            DirCache dc = DirCache.newInCore();

            byte[] path = Constants.encode("a");
            Assert.AreEqual(-1, dc.findEntry(path, path.Length));
        }
Exemplo n.º 2
0
        protected RevTree tree(params DirCacheEntry[] entries)
        {
            DirCache        dc = DirCache.newInCore();
            DirCacheBuilder b  = dc.builder();

            foreach (DirCacheEntry e in entries)
            {
                b.add(e);
            }
            b.finish();
            return(rw.lookupTree(dc.writeTree(_ow)));
        }
Exemplo n.º 3
0
        /**
         * Construct a tree from a specific listing of file entries.
         *
         * @param entries
         *            the files to include in the tree. The collection does not need
         *            to be sorted properly and may be empty.
         * @return reference to the tree specified by the entry list.
         * @throws Exception
         */
        public RevTree tree(params DirCacheEntry[] entries)
        {
            DirCache        dc = DirCache.newInCore();
            DirCacheBuilder b  = dc.builder();

            foreach (DirCacheEntry e in entries)
            {
                b.add(e);
            }
            b.finish();
            return(pool.lookupTree(dc.writeTree(writer)));
        }
Exemplo n.º 4
0
        public void testBuildRejectsUnsetFileMode()
        {
            DirCache        dc = DirCache.newInCore();
            DirCacheBuilder b  = dc.builder();

            Assert.IsNotNull(b);

            DirCacheEntry e = new DirCacheEntry("a");

            Assert.AreEqual(0, e.getRawMode());
            try
            {
                b.add(e);
            }
            catch (ArgumentException err)
            {
                Assert.AreEqual("FileMode not set for path a", err.Message);
            }
        }
Exemplo n.º 5
0
 public InCoreMerger(Repository local)
     : base(local)
 {
     _tw    = new NameConflictTreeWalk(Repository);
     _cache = DirCache.newInCore();
 }