Examples of editor()


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

   * @throws Exception
   */
  @Test
  public void testSymlinkModifiedNotNormalized() throws Exception {
    DirCache dc = db.lockDirCache();
    DirCacheEditor dce = dc.editor();
    final String NORMALIZED = "target";
    final byte[] NORMALIZED_BYTES = Constants.encode(NORMALIZED);
    ObjectInserter oi = db.newObjectInserter();
    final ObjectId linkid = oi.insert(Constants.OBJ_BLOB, NORMALIZED_BYTES,
        0, NORMALIZED_BYTES.length);
View Full Code Here

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

    ObjectInserter oi = db.newObjectInserter();
    final ObjectId linkid = oi.insert(Constants.OBJ_BLOB, NORMALIZED_BYTES,
        0, NORMALIZED_BYTES.length);
    oi.release();
    DirCache dc = db.lockDirCache();
    DirCacheEditor dce = dc.editor();
    dce.add(new DirCacheEditor.PathEdit("link") {
      @Override
      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.SYMLINK);
        ent.setObjectId(linkid);
View Full Code Here

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

      stashHeadIter.reset(reader, stashHeadTree);
      CanonicalTreeParser headIter = new CanonicalTreeParser();
      headIter.reset(reader, headTree);

      DirCache cache = repo.lockDirCache();
      DirCacheEditor editor = cache.editor();
      try {
        DirCacheIterator indexIter = new DirCacheIterator(cache);
        FileTreeIterator workingIter = new FileTreeIterator(repo);

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

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

  private void resetIndexForPaths(RevCommit commit) {
    DirCache dc = null;
    final DirCacheEditor edit;
    try {
      dc = repo.lockDirCache();
      edit = dc.editor();

      final TreeWalk tw = new TreeWalk(repo);
      tw.addTree(new DirCacheIterator(dc));
      tw.addTree(commit.getTree());
      tw.setFilter(PathFilterGroup.createFromStrings(filepaths));
View Full Code Here

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

  private void resetIndex(RevCommit commit) throws IOException {
    DirCache dc = repo.lockDirCache();
    TreeWalk walk = null;
    try {
      DirCacheEditor editor = dc.editor();

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

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

  protected CheckoutCommand checkoutPaths() throws IOException,
      RefNotFoundException {
    RevWalk revWalk = new RevWalk(repo);
    DirCache dc = repo.lockDirCache();
    try {
      DirCacheEditor editor = dc.editor();
      TreeWalk startWalk = new TreeWalk(revWalk.getObjectReader());
      startWalk.setRecursive(true);
      if (!checkoutAllPaths)
        startWalk.setFilter(PathFilterGroup.createFromStrings(paths));
      boolean checkoutIndex = startCommit == null && startPoint == null;
View Full Code Here

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

            headCommit.getShortMessage()));
        ObjectId indexCommit = inserter.insert(builder);

        // Commit working tree changes
        if (!wtEdits.isEmpty() || !wtDeletes.isEmpty()) {
          DirCacheEditor editor = cache.editor();
          for (PathEdit edit : wtEdits)
            editor.add(edit);
          for (String path : wtDeletes)
            editor.add(new DeletePath(path));
          editor.finish();
View Full Code Here

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

  private static void setIndexEntryContents(final Repository repository,
      final String gitPath, final byte[] newContent) {
    DirCache cache = null;
    try {
      cache = repository.lockDirCache();
      DirCacheEditor editor = cache.editor();
      if (newContent.length == 0) {
        editor.add(new DirCacheEditor.DeletePath(gitPath));
      } else {
        int length;
        byte[] content;
View Full Code Here

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

        tree.failed(new Status(IStatus.WARNING, Activator.getPluginId(),
            CoreText.MoveDeleteHook_unmergedFileError));
        return I_AM_DONE;
      }

      final DirCacheEditor sEdit = sCache.editor();
      sEdit.add(new DirCacheEditor.DeletePath(sEnt));
      if (dstm != null && dstm.getRepository() == srcm.getRepository()) {
        final String dPath = srcm.getRepoRelativePath(dstf);
        sEdit.add(new DirCacheEditor.PathEdit(dPath) {
          @Override
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot.editor()

  private final SWTBotEditor editor;

  public static CompareEditorTester forTitleContaining(String title) {
    SWTWorkbenchBot bot = new SWTWorkbenchBot();
    SWTBotEditor editor = bot.editor(new CompareEditorTitleMatcher(title));
    // Ensure that both StyledText widgets are enabled
    SWTBotStyledText styledText = editor.toTextEditor().getStyledText();
    bot.waitUntil(Conditions.widgetIsEnabled(styledText));
    return new CompareEditorTester(editor);
  }
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.