Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCache.builder()


    ObjectInserter inserter = repo.newObjectInserter();
    try {
      dc = repo.lockDirCache();
      DirCacheIterator c;

      DirCacheBuilder builder = dc.builder();
      final TreeWalk tw = new TreeWalk(repo);
      tw.addTree(new DirCacheBuildIterator(builder));
      if (workingTreeIterator == null)
        workingTreeIterator = new FileTreeIterator(repo);
      tw.addTree(workingTreeIterator);
View Full Code Here


    checkCallable();
    DirCache dc = null;

    try {
      dc = repo.lockDirCache();
      DirCacheBuilder builder = dc.builder();
      final TreeWalk tw = new TreeWalk(repo);
      tw.reset(); // drop the first empty tree, which we do not need here
      tw.setRecursive(true);
      tw.setFilter(PathFilterGroup.createFromStrings(filepatterns));
      tw.addTree(new DirCacheBuildIterator(builder));
View Full Code Here

      if (first < 0) {
        dirc.unlock();
        return false;
      }

      final DirCacheBuilder edit = dirc.builder();
      if (first > 0)
        edit.keep(0, first);
      final int next = dirc.nextEntry(first);
      if (next < dirc.getEntryCount())
        edit.keep(next, dirc.getEntryCount() - next);
View Full Code Here

    assertEquals("right", readContents(revision));
  }

  private void buildIndex(DirCacheEntry... entries) throws IOException {
    DirCache dirCache = repository.lockDirCache();
    DirCacheBuilder builder = dirCache.builder();
    try {
      for (DirCacheEntry entry : entries)
        builder.add(entry);
      builder.commit();
    } finally {
View Full Code Here

    String filePath = "file.txt";
    IFile file = testUtils.addFileToProject(project.getProject(), filePath, "some text");

    Repository repo = testRepository.getRepository();
    DirCache index = repo.lockDirCache();
    DirCacheBuilder builder = index.builder();
    addUnmergedEntry(filePath, builder);
    builder.commit();

    try {
      file.move(new Path("destination.txt"), false, null);
View Full Code Here

    String filePath = "folder/file.txt";
    IFile file = testUtils.addFileToProject(project.getProject(), filePath, "some text");

    Repository repo = testRepository.getRepository();
    DirCache index = repo.lockDirCache();
    DirCacheBuilder builder = index.builder();
    addUnmergedEntry(filePath, builder);
    builder.commit();

    try {
      project.getProject()
View Full Code Here

    DirCacheEditor dcEditor = index.editor();

    // get DirCacheBuilder for newly created in-core index to build a
    // temporary index for this commit
    DirCache inCoreIndex = DirCache.newInCore();
    DirCacheBuilder dcBuilder = inCoreIndex.builder();

    onlyProcessed = new boolean[only.size()];
    boolean emptyCommit = true;

    TreeWalk treeWalk = new TreeWalk(repo);
View Full Code Here

  private void resetIndex(RevTree tree) throws IOException {
    DirCache dc = repo.lockDirCache();
    TreeWalk walk = null;
    try {
      DirCacheBuilder builder = dc.builder();

      walk = new TreeWalk(repo);
      walk.addTree(tree);
      walk.addTree(new DirCacheIterator(dc));
      walk.setRecursive(true);
View Full Code Here

    DirCacheBuilder existingBuilder = index.builder();

    // get DirCacheBuilder for newly created in-core index to build a
    // temporary index for this commit
    DirCache inCoreIndex = DirCache.newInCore();
    DirCacheBuilder tempBuilder = inCoreIndex.builder();

    onlyProcessed = new boolean[only.size()];
    boolean emptyCommit = true;

    TreeWalk treeWalk = new TreeWalk(repo);
View Full Code Here

   * @return a new in memory dircache
   * @throws IOException
   */
  private DirCache dircacheFromTree(ObjectId treeId) throws IOException {
    DirCache ret = DirCache.newInCore();
    DirCacheBuilder builder = ret.builder();
    TreeWalk tw = new TreeWalk(db);
    tw.addTree(treeId);
    tw.setRecursive(true);
    while (tw.next()) {
      DirCacheEntry e = new DirCacheEntry(tw.getRawPath());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.