Package org.eclipse.jgit.api

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


  @Test
  public void testCleanStateAfterInit() throws NoWorkTreeException,
      GitAPIException {
    Git parentGit = Git.wrap(parentRepository.getRepository());

    Status status = parentGit.status().setWorkingTreeIt(treeIt).call();
    assertTrue(status.isClean());
  }

  @Test
  public void testCleanStateFirstCommit() throws NoWorkTreeException,
View Full Code Here


    RepositoryTestCase.fsTick(null);
    parentRepository.trackAllFiles(parentProject);
    parentRepository.commit("modified parent.txt");
    Git parentGit = Git.wrap(parentRepository.getRepository());

    Status status = parentGit.status().setWorkingTreeIt(treeIt).call();
    assertTrue(status.isClean());
  }
}
View Full Code Here

  }

  @VisibleForTesting
  boolean findDirtyState(Repository repo) throws GitAPIException {
    Git git = Git.wrap(repo);
    Status status = git.status().call();

    // Git describe doesn't mind about untracked files when checking if
    // repo is dirty. JGit does this, so we cannot use the isClean method
    // to get the same behaviour. Instead check dirty state without
    // status.getUntracked().isEmpty()
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);
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);
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

    @TaskAction
    public void release() throws Exception {
        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");
        }
    }
}
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.