Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.RmCommand


  private List<String> paths = new ArrayList<String>();


  @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


      deleteFile(missingTxt);

      // 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);
      response = webConversation.getResponse(request);
View Full Code Here

      resetCommand.setRef(HEAD);
      for (String path : paths)
        resetCommand.addPath(getCommandPath(path));
      return resetCommand;
    } else {
      RmCommand rmCommand = git.rm();
      rmCommand.setCached(true);
      for (String path : paths)
        rmCommand.addFilepattern(getCommandPath(path));
      return rmCommand;
    }
  }
View Full Code Here

      } catch (Exception e1) {
        Activator.handleError(e1.getMessage(), e1, true);
      }
    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(),
            true);
View Full Code Here

  @Override
  public void delete(FileVersion... files) {
    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);
    }
    persistence.delete(files);
View Full Code Here

     * Removes a file pattern
     *
     * @param filePattern the file pattern
     */
    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

     * Removes a file pattern
     *
     * @param filePattern the file pattern
     */
    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

Related Classes of org.eclipse.jgit.api.RmCommand

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.