Package org.eclipse.jgit.lib
Class BranchConfig
java.lang.Object
org.eclipse.jgit.lib.BranchConfig
Branch section of a Git configuration file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConfig values for branch.[name].rebase (and pull.rebase). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Configstatic final StringThe value that means "local repository" forgetRemote(): "." -
Constructor Summary
ConstructorsConstructorDescriptionBranchConfig(Config config, String branchName) Create a new branch config, which will read configuration from config about specified branch. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringfindRemoteTrackingBranch(String remote, String mergeRef) Finds the tracked remote tracking branchgetMerge()Get the name of the upstream branch as it is called on the remoteGet the remote this branch is configured to push to.Retrieves the config value of branch.[name].rebase.Get the remote this branch is configured to fetch from/push toprivate StringGet the full remote-tracking branch nameGet the full tracking branch namebooleanisRebase()Whether the branch is configured to be rebasedbooleanWhether the "remote" setting points to the local repository (with ".")
-
Field Details
-
LOCAL_REPOSITORY
The value that means "local repository" forgetRemote(): "."- Since:
- 3.5
- See Also:
-
config
-
branchName
-
-
Constructor Details
-
BranchConfig
Create a new branch config, which will read configuration from config about specified branch.- Parameters:
config- the config to read frombranchName- the short branch name of the section to read
-
-
Method Details
-
getTrackingBranch
Get the full tracking branch name- Returns:
- the full tracking branch name or
nullif it could not be determined
-
getRemoteTrackingBranch
Get the full remote-tracking branch name- Returns:
- the full remote-tracking branch name or
nullif it could not be determined. If you also want local tracked branches usegetTrackingBranch()instead.
-
isRemoteLocal
public boolean isRemoteLocal()Whether the "remote" setting points to the local repository (with ".")- Returns:
trueif the "remote" setting points to the local repository (with "."), false otherwise- Since:
- 3.5
-
getRemote
Get the remote this branch is configured to fetch from/push to- Returns:
- the remote this branch is configured to fetch from/push to, or
nullif not defined - Since:
- 3.5
-
getPushRemote
Get the remote this branch is configured to push to.- Returns:
- the remote this branch is configured to push to, or
nullif not defined - Since:
- 6.1
-
getMerge
Get the name of the upstream branch as it is called on the remote- Returns:
- the name of the upstream branch as it is called on the remote, or
nullif not defined - Since:
- 3.5
-
isRebase
public boolean isRebase()Whether the branch is configured to be rebased- Returns:
trueif the branch is configured to be rebased- Since:
- 3.5
-
getRebaseMode
Retrieves the config value of branch.[name].rebase.- Returns:
- the
BranchConfig.BranchRebaseMode - Since:
- 4.5
-
findRemoteTrackingBranch
Finds the tracked remote tracking branch- Parameters:
remote- Remote namemergeRef- merge Ref of the local branch tracking the remote tracking branch- Returns:
- full remote tracking branch name or null
-
getRemoteOrDefault
-