Top Description Fields Constructors Methods
org.eclipse.jgit.lib

public Class BranchTrackingStatus

extends Object
Class Inheritance
Imports
java.io.IOException, org.eclipse.jgit.revwalk.RevCommit, .RevWalk, .RevWalkUtils, org.eclipse.jgit.revwalk.filter.RevFilter

Status of a branch's relation to its remote-tracking branch.

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final String

Constructor Summary

AccessConstructor and Description
private
BranchTrackingStatus(String remoteTrackingBranch, int aheadCount, int behindCount)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

number of commits that the local branch is ahead of the remote-tracking branch
getAheadCount
()

Get number of commits that the local branch is ahead of the remote-tracking branch

public int

Returns:

number of commits that the local branch is behind of the remote-tracking branch
getBehindCount
()

Get number of commits that the local branch is behind of the remote-tracking branch

public String

Returns:

full remote-tracking branch name
getRemoteTrackingBranch
()

Get full remote-tracking branch name

public static BranchTrackingStatus

Returns:

the tracking status, or null if it is not known
of
(Repository
the git repository to compute the status from
repository
,
String
the local branch
branchName
)

Compute the tracking status for the branchName in repository.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aheadCountback to summary
private final int aheadCount
behindCountback to summary
private final int behindCount
remoteTrackingBranchback to summary
private final String remoteTrackingBranch

Constructor Detail

BranchTrackingStatusback to summary
private BranchTrackingStatus(String remoteTrackingBranch, int aheadCount, int behindCount)

Method Detail

getAheadCountback to summary
public int getAheadCount()

Get number of commits that the local branch is ahead of the remote-tracking branch

Returns:int

number of commits that the local branch is ahead of the remote-tracking branch

getBehindCountback to summary
public int getBehindCount()

Get number of commits that the local branch is behind of the remote-tracking branch

Returns:int

number of commits that the local branch is behind of the remote-tracking branch

getRemoteTrackingBranchback to summary
public String getRemoteTrackingBranch()

Get full remote-tracking branch name

Returns:String

full remote-tracking branch name

ofback to summary
public static BranchTrackingStatus of(Repository repository, String branchName) throws IOException

Compute the tracking status for the branchName in repository.

Parameters
repository:Repository

the git repository to compute the status from

branchName:String

the local branch

Returns:BranchTrackingStatus

the tracking status, or null if it is not known

Exceptions
IOException:
if an IO error occurred