Package org.eclipse.jgit.treewalk

Examples of org.eclipse.jgit.treewalk.TreeWalk.release()


    try {
      walk.addTree(commit.getParent(1).getTree());
      walk.addTree(commit.getTree());
      return DiffEntry.scan(walk);
    } finally {
      walk.release();
    }
  }

  @Test
  public void noLocalChanges() throws Exception {
View Full Code Here


      return tw != null;
    } finally {
      rw.release();
      rw.dispose();
      if (tw != null)
        tw.release();
    }
  }

  /**
   * Checks if a file with the given path exists in the index
View Full Code Here

    } catch (IOException e) {
      // TODO(jrn): Throw finer-grained errors.
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfArchiveCommand, e);
    } finally {
      walk.release();
    }
  }

  /**
   * @return the stream to which the archive has been written
View Full Code Here

      builder.commit();
    } finally {
      dc.unlock();
      if (walk != null)
        walk.release();
    }
  }

  private void resetUntracked(RevTree tree) throws CheckoutConflictException,
      IOException {
View Full Code Here

        checkoutPath(entry, reader);
      }
    } finally {
      if (walk != null)
        walk.release();
    }
  }

  private void checkoutPath(DirCacheEntry entry, ObjectReader reader) {
    try {
View Full Code Here

          entry.setLength(fIter.getEntryLength());
          entry.setLastModified(fIter.getEntryLastModified());
        }
      }
    } finally {
      walk.release();
    }
  }
}
View Full Code Here

      builder.commit();
    } finally {
      dc.unlock();
      if (walk != null)
        walk.release();
    }
  }

  private void checkoutIndex(ObjectId commitTree) throws IOException,
      GitAPIException {
View Full Code Here

        + "[unmerged2, mode:100644, stage:3]",
        indexState(0));

    TreeWalk walk = TreeWalk.forPath(db, "unmerged1", commit.getTree());
    assertEquals(FileMode.REGULAR_FILE, walk.getFileMode(0));
    walk.release();
  }

  private static void addUnmergedEntry(String file, DirCacheBuilder builder) {
    DirCacheEntry stage1 = new DirCacheEntry(file, DirCacheEntry.STAGE_1);
    DirCacheEntry stage2 = new DirCacheEntry(file, DirCacheEntry.STAGE_2);
View Full Code Here

        else {
          RevCommit commit = revWalk.parseCommit(getStartPointObjectId());
          checkoutPathsFromCommit(treeWalk, dc, commit);
        }
      } finally {
        treeWalk.release();
      }
    } finally {
      dc.unlock();
      revWalk.release();
    }
View Full Code Here

    treeWalk.addTree(id);

    treeWalk.setFilter(TreeFilter.ANY_DIFF);

    boolean needsCommit = treeWalk.next();
    treeWalk.release();

    if (needsCommit) {
      CommitCommand commit = new Git(repo).commit();
      commit.setMessage(rebaseState.readFile(MESSAGE));
      commit.setAuthor(parseAuthor());
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.