Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.AddCommand.call()


    for (int i = 0; i < paths.length(); i++) {
      add.addFilepattern(paths.getString(i));
    }
    // "git add {pattern}"
    try {
      add.call();
    } catch (GitAPIException e) {
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage(),
          e));
    }
View Full Code Here


    add = git.add().setUpdate(true);
    for (int i = 0; i < paths.length(); i++) {
      add.addFilepattern(paths.getString(i));
    }
    try {
      add.call();
    } catch (GitAPIException e) {
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage(),
          e));
    }
    return true;
View Full Code Here

                String path = relativize( baseUri, file );
                add.addFilepattern( path );
                add.addFilepattern( file.getAbsolutePath() );
            }
        }
        add.call();
       
        Status status = git.status().call();

        Set<String> allInIndex = new HashSet<String>();
        allInIndex.addAll( status.getAdded() );
View Full Code Here

                    {
                        getLogger().debug( "add manualy: " + changed );
                        add.addFilepattern( changed );
                        doCommit = true;
                    }
                    add.call();
                }
            }

            List<ScmFile> checkedInFiles = Collections.emptyList();
            if ( doCommit )
View Full Code Here

  private void addAndCommit(Repository r, String filePattern, String msg) throws IOException{
        try {
            Git git = new Git(r);
            AddCommand cmd = git.add();
            cmd.addFilepattern(filePattern);
            cmd.call();

            CommitCommand co = git.commit();
            co.setAuthor("Jenkow","noreply@jenkins-ci.org");
            co.setMessage(msg);
            co.call();
View Full Code Here

                        pomPath = StringUtils.replace(pomPath,"\\","/");   
                    }
                   
                    add.addFilepattern(pomPath);
                }
                add.call();
                git.commit().setMessage(message).call();
            }
        }
        catch (GitAPIException e)
        {
View Full Code Here

                    {
                        getLogger().debug("adding file pattern for poms commit: " + pomPath);
                    }
                    add.addFilepattern(pomPath);
                }
                add.call();
                git.commit().setMessage(message).call();
            }
        }
        catch (GitAPIException e)
        {
View Full Code Here

      for (String s : status.getUntracked()) {
        getLog().info("Adding file " + s);
        addCommand.addFilepattern(s);
      }

      addCommand.call();
    }

    git.commit().setAll(true).setMessage(versionDescription).call();

    String commitId = ObjectId.toString(git.getRepository()
View Full Code Here

        addCommand.addFilepattern(path);
        fileAdded = true;
      }
    if (fileAdded)
      try {
        addCommand.call();
      } catch (Exception e) {
        throw new CoreException(Activator.error(e.getMessage(), e));
      }
  }
View Full Code Here

    if (!addPaths.isEmpty())
      try {
        AddCommand add = git.add();
        for (String addPath : addPaths)
          add.addFilepattern(addPath);
        add.call();
      } catch (NoFilepatternException e1) {
        // cannot happen
      } catch (JGitInternalException e1) {
        Activator.handleError(e1.getCause().getMessage(),
            e1.getCause(), true);
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.