Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.status()


    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");
View Full Code Here


      File gitDir = set.iterator().next().getValue();
      if (gitDir == null)
        return false; // TODO: or an error response code, 405?
      db = FileRepositoryBuilder.create(gitDir);
      Git git = new Git(db);
      org.eclipse.jgit.api.Status gitStatus = git.status().call();

      URI baseLocation = getURI(request);
      String relativePath = GitUtils.getRelativePath(path, set.iterator().next().getKey());
      IPath basePath = new Path(relativePath);
      Status status = new Status(baseLocation, db, gitStatus, basePath);
View Full Code Here

    {
        try
        {
            Git git = flow.git();

            Status status = git.status().call();
            if (!status.isClean())
            {
                git.add().addFilepattern(".").call();
                git.commit().setMessage(commitMessage).call();
            }
View Full Code Here

    public void commitAllChanges(final String message) {
        final Repository repository = getRepository();
        try {
            final Git git = new Git(repository);
            git.add().addFilepattern(".").call();
            final Status status = git.status().call();
            if (status.getChanged().size() > 0 || status.getAdded().size() > 0
                    || status.getModified().size() > 0
                    || status.getRemoved().size() > 0) {
                final RevCommit rev = git.commit().setAll(true)
                        .setCommitter(person).setAuthor(person)
View Full Code Here

                doCommit = JGitUtils.addAllFiles( git, fileSet ).size() > 0;
            }
            else
            {
                // add all tracked files which are modified manually
                Set<String> changeds = git.status().call().getModified();
                if ( changeds.isEmpty() )
                {
                    // warn there is nothing to add
                    getLogger().warn( "there are no files to be added" );
                    doCommit = false;
View Full Code Here

            commitVersion = version;
        }
        setVersion(getProject(), commitVersion);

        final Git git = git(getProject());
        if (git.status().call().hasUncommittedChanges()) {
            final ReleaseConvention releaseConvention = releaseConvention(getProject());
            final String commitMessage =
                MessageFormat.format(releaseConvention.getThisVersionCommitMessageFormat(), version);
            commitPropertiesFile(getProject(), commitMessage);
        }
View Full Code Here

        if (releaseConvention.isEnsureWorkspaceClean()) {
            final Repository repo = repository(getProject());
            final Git git = new Git(repo);

            if (git.status().call().hasUncommittedChanges()) {
                throw new ReleaseException("The working tree has uncommitted changes");
            }
        }
        else {
            log.info("Skipping check for clean workspace");
View Full Code Here

        }
        setVersion(getProject(), nextVersion);

        final Git git = git(getProject());

        if (git.status().call().hasUncommittedChanges()) {
            final String commitMessage =
                    MessageFormat.format(releaseConvention.getNextVersionCommitMessageFormat(), nextVersion);
            commitPropertiesFile(getProject(), commitMessage);
        }
    }
View Full Code Here

            commitVersion = version;
        }
        setVersion(getProject(), commitVersion);

        final Git git = git(getProject());
        if (git.status().call().hasUncommittedChanges()) {
            final ReleaseConvention releaseConvention = releaseConvention(getProject());
            final String commitMessage =
                MessageFormat.format(releaseConvention.getThisVersionCommitMessageFormat(), commitVersion);
            commitPropertiesFile(getProject(), commitMessage);
        }
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;
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.