Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Status


    @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


    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();
            Repository repository = git.getRepository();
            File repoDir = repository.getDirectory().getParentFile();
            if (!status.isClean())
            {
                AddCommand add = git.add();

                MavenProject rootProject = ReleaseUtil.getRootProject(reactorProjects);
//                File rootBaseDir = rootProject.getBasedir();
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

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

    {
        String fullBranchName = branchHelper.getCurrentBranchName();
       
        try
        {
            Status status = git.status().call();
            Repository repository = git.getRepository();

            if (getLogger().isDebugEnabled())
            {
                getLogger().debug("(" + fullBranchName + ") committing all poms on branch '" + repository.getBranch() + "'");
            }
           
            File canonicalRepoDir;

            {
                // MJF-111. Canonicalize repoDir, getAbsolutePath is not enough
                File repoDir = repository.getDirectory().getParentFile();

                try
                {
                    canonicalRepoDir = repoDir.getCanonicalFile();
                }
                catch (IOException e)
                {
                    throw
                            new MavenJGitFlowException(
                                    "Cannot get canonical name for repository directory <" +
                                            repoDir + ">",
                                    e
                            );
                }
            }

            if (!status.isClean())
            {
                AddCommand add = git.add();

                MavenProject rootProject = ReleaseUtil.getRootProject(reactorProjects);
//                File rootBaseDir = rootProject.getBasedir();
View Full Code Here

  @Override
  protected Object executeInternal() throws Exception {
    Git git = getGitRepo();

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

    if (status.isClean()) {
      getLog().info("No Changes");

      return null;
    }

    // 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 = 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

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.