Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileRepository


   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdEmptyRevision() throws IOException {
    TreeUtils.getId(new FileRepository(testRepo), "", "folder");
  }
View Full Code Here


   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdNullPath1() throws IOException {
    TreeUtils.getId(new FileRepository(testRepo), ObjectId.zeroId(), null);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdNullPath2() throws IOException {
    TreeUtils.getId(new FileRepository(testRepo), Constants.MASTER, null);
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdEmptyPath1() throws IOException {
    TreeUtils.getId(new FileRepository(testRepo), ObjectId.zeroId(), "");
  }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void getIdEmptyPath2() throws IOException {
    TreeUtils.getId(new FileRepository(testRepo), Constants.MASTER, "");
  }
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void getIdWithCommit() throws Exception {
    Repository repo = new FileRepository(testRepo);
    RevCommit commit = add("d1/f1.txt", "content");
    assertNull(TreeUtils.getId(repo, commit, "d2/f1.txt"));
    assertNull(TreeUtils.getId(repo, commit, "d1/f1.txt"));
    ObjectId treeId = TreeUtils.getId(repo, commit, "d1");
    assertNotNull(treeId);
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void getIdWithRevision() throws Exception {
    Repository repo = new FileRepository(testRepo);
    RevCommit commit = add("d1/f1.txt", "content");
    assertNull(TreeUtils.getId(repo, Constants.MASTER, "d2/f1.txt"));
    assertNull(TreeUtils.getId(repo, Constants.MASTER, "d1/f1.txt"));
    ObjectId treeId = TreeUtils.getId(repo, Constants.MASTER, "d1");
    assertNotNull(treeId);
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void visitNullTreeId() throws IOException {
    TreeUtils.visit(new FileRepository(testRepo), null, new ITreeVisitor() {

      public boolean accept(FileMode mode, String path, String name,
          AnyObjectId id) {
        return false;
      }
View Full Code Here

   *
   * @throws IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void visitNullVisitor() throws IOException {
    TreeUtils.visit(new FileRepository(testRepo), ObjectId.zeroId(), null);
  }
View Full Code Here

        Arrays.asList("x1", "x2", "x3"));
    final AtomicInteger files = new AtomicInteger(0);
    final AtomicInteger folders = new AtomicInteger(0);
    final List<String> fullPaths = new ArrayList<String>();
    final Set<AnyObjectId> ids = new HashSet<AnyObjectId>();
    assertTrue(TreeUtils.visit(new FileRepository(testRepo),
        commit.getTree(), new ITreeVisitor() {

          public boolean accept(FileMode mode, String path,
              String name, AnyObjectId id) {
            if (mode == REGULAR_FILE)
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.FileRepository

Copyright © 2018 www.massapicom. 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.