Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.RmCommand.addFilepattern()


  @Override
  protected void run() throws Exception {
    RmCommand command = new Git(db).rm();
    for (String p : paths)
      command.addFilepattern(p);
    command.call();
  }

}
View Full Code Here


      // remove the file
      Repository repository = getRepositoryForContentLocation(cloneContentLocation);
      Git git = new Git(repository);
      RmCommand rm = git.rm();
      rm.addFilepattern(removedFileName);
      rm.call();

      // untracked file
      String untrackedFileName = "untracked.txt";
      request = getPostFilesRequest(folder.getString(ProtocolConstants.KEY_LOCATION), getNewFileJSON(untrackedFileName).toString(), untrackedFileName);
View Full Code Here

      return resetCommand;
    } else {
      RmCommand rmCommand = git.rm();
      rmCommand.setCached(true);
      for (String path : paths)
        rmCommand.addFilepattern(getCommandPath(path));
      return rmCommand;
    }
  }

  private static boolean hasHead(Repository repository) {
View Full Code Here

      }
    if (!rmPaths.isEmpty())
      try {
        RmCommand rm = git.rm().setCached(true);
        for (String rmPath : rmPaths)
          rm.addFilepattern(rmPath);
        rm.call();
      } catch (NoFilepatternException e) {
        // cannot happen
      } catch (JGitInternalException e) {
        Activator.handleError(e.getCause().getMessage(), e.getCause(),
View Full Code Here

    Repository repository = getRepository(files[0].getFile());
    Git git = new Git(repository);
    try {
      RmCommand remover = git.rm();
      for (FileVersion fileVersion : files) {
        remover.addFilepattern(getPath(fileVersion.getFile(), repository));
      }
      remover.call();
      commit(git, String.format("[FitNesse] Deleted files: %s.", formatFileVersions(files)), files[0].getAuthor());
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

    public void remove(String filePattern) {
        RmCommand remove = git.rm();

        DirCache cache;
        try {
            cache = remove.addFilepattern(filePattern).call();
            updateCache(cache);
        } catch (NoFilepatternException e) {
            throw new IllegalStateException("Unable to remove file from the Git cache", e);
        } catch (IOException e) {
            throw new IllegalStateException("Unable to remove file from the Git cache", e);
View Full Code Here

    public void remove(String filePattern) {
        RmCommand remove = git.rm();

        DirCache cache;
        try {
            cache = remove.addFilepattern(filePattern).call();
            updateCache(cache);
        } catch (NoFilepatternException e) {
            throw new IllegalStateException("Unable to remove file from the Git cache", e);
        } catch (IOException e) {
            throw new IllegalStateException("Unable to remove file from the Git cache", e);
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.