public void testFindOnEmpty() { DirCache dc = DirCache.newInCore(); byte[] path = Constants.encode("a"); Assert.AreEqual(-1, dc.findEntry(path, path.Length)); }
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))); }
/** * 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))); }
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); } }
public InCoreMerger(Repository local) : base(local) { _tw = new NameConflictTreeWalk(Repository); _cache = DirCache.newInCore(); }