Examples of BranchTrackingStatus


Examples of org.eclipse.jgit.lib.BranchTrackingStatus

    if (branch != null) {
      string.append(' ');
      string.append('[', StyledString.DECORATIONS_STYLER);
      string.append(branch, StyledString.DECORATIONS_STYLER);

      BranchTrackingStatus trackingStatus = BranchTrackingStatus.of(
          repository, branch);
      if (trackingStatus != null
          && (trackingStatus.getAheadCount() != 0 || trackingStatus
              .getBehindCount() != 0)) {
        String formattedTrackingStatus = GitLabels
            .formatBranchTrackingStatus(trackingStatus);
        string.append(' ');
        string.append(formattedTrackingStatus,
View Full Code Here

Examples of org.eclipse.jgit.lib.BranchTrackingStatus

  static String getBranchStatus(Repository repo) throws IOException {
    String branchName = repo.getBranch();
    if (branchName == null)
      return null;

    BranchTrackingStatus status = BranchTrackingStatus.of(repo, branchName);
    if (status == null)
      return null;

    if (status.getAheadCount() == 0 && status.getBehindCount() == 0)
      return null;

    String formattedStatus = GitLabels.formatBranchTrackingStatus(status);
    return formattedStatus;
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.BranchTrackingStatus

        repository.close();
    }

    private static List<Integer> getCounts(org.eclipse.jgit.lib.Repository repository, String branchName) throws IOException {
        BranchTrackingStatus trackingStatus = BranchTrackingStatus.of(repository, branchName);
        List<Integer> counts = new ArrayList<Integer>();
        if (trackingStatus != null) {
            counts.add(trackingStatus.getAheadCount());
            counts.add(trackingStatus.getBehindCount());
        } else {
            System.out.println("Returned null, likely no remote tracking of branch " + branchName);
            counts.add(0);
            counts.add(0);
        }
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.