Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Status


        for (File file : workTreeFilesToDelete)
        {
            FileUtils.deleteQuietly(file);
        }

        Status status = git.status().call();
        if (!status.getAdded().isEmpty() ||
            !status.getChanged().isEmpty() ||
            !status.getMissing().isEmpty() ||
            !status.getRemoved().isEmpty() ||
            !status.getUntracked().isEmpty())
        {
            git.commit().
                setAll(true).
                setAuthor(event.getUserName(), event.getUserEmail()).
                setCommitter("speakeasy", "speakeasy@atlassian.com").
View Full Code Here


    Ref masterRef = gitRepo.getRepository()
            .getRef("master");
    if (null != masterRef)
      commitId = ObjectId.toString(masterRef.getObjectId());

    Status status = gitRepo.status().call();

    AddCommand addCommand = gitRepo.add();

    if (!status.getUntracked().isEmpty()) {
      for (String s : status.getUntracked()) {
        log("Adding file %s", s);
        addCommand.addFilepattern(s);
      }

      addCommand.call();
View Full Code Here

    Ref masterRef = git.getRepository()
        .getRef("master");
    if (null != masterRef)
      commitId = ObjectId.toString(masterRef.getObjectId());

    Status status = git.status().call();

    boolean pushAhead = false;

    if (null != commitId && status.isClean()) {
      versionLabel = lookupVersionLabelForCommitId(commitId);

      if (null == versionLabel) {
        getLog().info("No Changes. However, we've didn't get something close in AWS Elastic Beanstalk and we're pushing ahead");
        pushAhead = true;
      } else {
        getLog().info("No Changes. However, we've got something close in AWS Elastic Beanstalk and we're continuing");

        project.getProperties().put("beanstalk.versionLabel", versionLabel);

        return null;
      }
    }

    if (!pushAhead) {
      // Asks for Existing Files to get added
      git.add().setUpdate(true).addFilepattern(".").call();

      // Now as for any new files (untracked)

      AddCommand addCommand = git.add();

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

        addCommand.call();
View Full Code Here

    Ref masterRef = git.getRepository()
        .getRef("master");
    if (null != masterRef)
      commitId = ObjectId.toString(masterRef.getObjectId());

    Status status = git.status().call();

    boolean pushAhead = false;

    if (null != commitId && status.isClean()) {
      versionLabel = lookupVersionLabelForCommitId(commitId);

      if (null == versionLabel) {
        getLog().info("No Changes. However, we've didn't get something close in AWS Elastic Beanstalk and we're pushing ahead");
        pushAhead = true;
      } else {
        getLog().info("No Changes. However, we've got something close in AWS Elastic Beanstalk and we're continuing");

        project.getProperties().put("beanstalk.versionLabel", versionLabel);

        return null;
      }
    }

    if (!pushAhead) {
      // Asks for Existing Files to get added
      git.add().setUpdate(true).addFilepattern(".").call();

      // Now as for any new files (untracked)

      AddCommand addCommand = git.add();

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

        addCommand.call();
View Full Code Here

    @Override
    public void commitAllChanges(Git git, String message) throws JGitFlowReleaseException
    {
        try
        {
            Status status = git.status().call();
            if(!status.isClean())
            {
                git.add().addFilepattern(".").call();
                git.commit().setMessage(message).call();
            }
        }
View Full Code Here

    @Override
    public void commitAllPoms(Git git, List<MavenProject> reactorProjects, String message) throws JGitFlowReleaseException
    {
        try
        {
            Status status = git.status().call();
            if(!status.isClean())
            {
                AddCommand add = git.add();
               
                MavenProject rootProject = ReleaseUtil.getRootProject(reactorProjects);
                File rootBaseDir = rootProject.getBasedir();
View Full Code Here

                add.addFilepattern( file.getAbsolutePath() );
            }
        }
        add.call();
       
        Status status = git.status().call();

        Set<String> allInIndex = new HashSet<String>();
        allInIndex.addAll( status.getAdded() );
        allInIndex.addAll( status.getChanged() );

        // System.out.println("All in index: "+allInIndex.size());

        List<ScmFile> addedFiles = new ArrayList<ScmFile>( allInIndex.size() );
View Full Code Here

    {
        Git git = null;
        try
        {
            git = Git.open( fileSet.getBasedir() );
            Status status = git.status().call();
            List<ScmFile> changedFiles = getFileStati( status );

            return new StatusScmResult( "JGit status", changedFiles );
        }
        catch ( Exception e )
View Full Code Here

    db.getFS().setExecute(file, true);
    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit2").call();

    // Verify executable and working directory is clean
    Status status = git.status().call();
    assertTrue(status.getModified().isEmpty());
    assertTrue(status.getChanged().isEmpty());
    assertTrue(db.getFS().canExecute(file));

    // Switch branches
    git.checkout().setName("b1").call();

    // Verify not executable and working directory is clean
    status = git.status().call();
    assertTrue(status.getModified().isEmpty());
    assertTrue(status.getChanged().isEmpty());
    assertFalse(db.getFS().canExecute(file));
  }
View Full Code Here

    db.getFS().setExecute(file, true);
    git.add().addFilepattern("file.txt").call();
    git.commit().setMessage("commit2").call();

    // Verify executable and working directory is clean
    Status status = git.status().call();
    assertTrue(status.getModified().isEmpty());
    assertTrue(status.getChanged().isEmpty());
    assertTrue(db.getFS().canExecute(file));

    writeTrashFile("file.txt", "b");

    // Switch branches
View Full Code Here

TOP

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

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.