Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCacheBuilder.commit()


      if (first > 0)
        edit.keep(0, first);
      final int next = dirc.nextEntry(first);
      if (next < dirc.getEntryCount())
        edit.keep(next, dirc.getEntryCount() - next);
      if (!edit.commit())
        tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(),
            0, CoreText.MoveDeleteHook_operationError, null));
      tree.standardDeleteFile(file, updateFlags, monitor);
    } catch (IOException e) {
      tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
View Full Code Here


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

    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);
      fail("Expected move of file with conflicts to fail.");
    } catch (CoreException e) {
View Full Code Here

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

    try {
      project.getProject()
          .getFolder("folder")
          .move(project.getProject().getFolder("newfolder")
View Full Code Here

        }

        builder.add(entry);
      }

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

            // the file or symlink named by the tree entry.
            delete(path);
          }
        }
      }
      builder.commit();
      setCallable(false);
    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfRmCommand, e);
    } finally {
View Full Code Here

          entry.setObjectId(tree.getEntryObjectId());
          builder.add(entry);
        }
      }

      builder.commit();
    } catch (IOException e) {
      throw new RuntimeException(e);
    } finally {
      if (dc != null)
        dc.unlock();
View Full Code Here

        }

        builder.add(entry);
      }

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

        }

        builder.add(entry);
      }

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

              builder.add(c.getDirCacheEntry());
          }
        }
      }
      inserter.flush();
      builder.commit();
      setCallable(false);
    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e);
    } finally {
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.