Package org.eclipse.jgit.treewalk.FileTreeIterator

Examples of org.eclipse.jgit.treewalk.FileTreeIterator.FileEntry


    Ref branch_1 = git.branchCreate().setName("branch_1").call();
    writeTrashFile("a", "b");
    git.add().addFilepattern("a").call();
    git.commit().setMessage("add file a").call();

    FileEntry entry = new FileTreeIterator.FileEntry(new File(
        db.getWorkTree(), "a"), db.getFS());
    assertEquals(FileMode.REGULAR_FILE, entry.getMode());

    git.rm().addFilepattern("a").call();
    FileUtils.mkdirs(new File(db.getWorkTree(), "a"));
    writeTrashFile("a/c", "Hello world c");
    git.add().addFilepattern(".").call();

    entry = new FileTreeIterator.FileEntry(new File(db.getWorkTree(), "a"),
        db.getFS());
    assertEquals(FileMode.TREE, entry.getMode());

    CheckoutConflictException exception = null;
    try {
      git.checkout().setName(branch_1.getName()).call();
    } catch (CheckoutConflictException e) {
View Full Code Here


    git.rm().addFilepattern("a").call();
    writeTrashFile("a", "Hello world a");
    git.add().addFilepattern("a").call();
    git.commit().setMessage("add file a").call();

    FileEntry entry = new FileTreeIterator.FileEntry(new File(
        db.getWorkTree(), "a"), db.getFS());
    assertEquals(FileMode.REGULAR_FILE, entry.getMode());

    git.rm().addFilepattern("a").call();
    FileUtils.mkdirs(new File(db.getWorkTree(), "a"));
    writeTrashFile("a/c", "Hello world c");
    git.add().addFilepattern(".").call();

    entry = new FileTreeIterator.FileEntry(new File(db.getWorkTree(), "a"),
        db.getFS());
    assertEquals(FileMode.TREE, entry.getMode());

    CheckoutConflictException exception = null;
    try {
      git.checkout().setName(branch_1.getName()).call();
    } catch (CheckoutConflictException e) {
View Full Code Here

        ResourceEntry resourceEntry = (ResourceEntry) current();
        return new ContainerTreeIterator(this,
            (IContainer) resourceEntry.rsrc,
            resourceEntry.hasInheritedResourceFilters);
      } else if (current() instanceof FileEntry) {
        FileEntry fileEntry = (FileEntry) current();
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        return new AdaptableFileTreeIterator(this, fileEntry.getFile(), root);
      } else {
        throw new IllegalStateException("Unknown entry type: " + current()); //$NON-NLS-1$
      }
    } else
      throw new IncorrectObjectTypeException(ObjectId.zeroId(),
View Full Code Here

      if (container != null && container.isAccessible())
        // Resource filters does not cross the non-member line
        // -> stop inheriting resource filter here (false)
        addToEntries.add(new ResourceEntry(container, false));
      else
        addToEntries.add(new FileEntry(child, FS.DETECTED));
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.treewalk.FileTreeIterator.FileEntry

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.