public class BranchConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
BranchConfig.BranchRebaseMode
Config values for branch.[name].rebase (and pull.rebase).
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
branchName |
private Config |
config |
static java.lang.String |
LOCAL_REPOSITORY
The value that means "local repository" for
getRemote() :
"." |
Constructor and Description |
---|
BranchConfig(Config config,
java.lang.String branchName)
Create a new branch config, which will read configuration from config
about specified branch.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
findRemoteTrackingBranch(java.lang.String remote,
java.lang.String mergeRef)
Finds the tracked remote tracking branch
|
java.lang.String |
getMerge()
Get the name of the upstream branch as it is called on the remote
|
BranchConfig.BranchRebaseMode |
getRebaseMode()
Retrieves the config value of branch.[name].rebase.
|
java.lang.String |
getRemote()
Get the remote this branch is configured to fetch from/push to
|
private java.lang.String |
getRemoteOrDefault() |
java.lang.String |
getRemoteTrackingBranch()
Get the full remote-tracking branch name
|
java.lang.String |
getTrackingBranch()
Get the full tracking branch name
|
boolean |
isRebase()
Whether the branch is configured to be rebased
|
boolean |
isRemoteLocal()
Whether the "remote" setting points to the local repository (with
".")
|
public static final java.lang.String LOCAL_REPOSITORY
getRemote()
:
"."private final Config config
private final java.lang.String branchName
public BranchConfig(Config config, java.lang.String branchName)
config
- the config to read frombranchName
- the short branch name of the section to readpublic java.lang.String getTrackingBranch()
null
if it could
not be determinedpublic java.lang.String getRemoteTrackingBranch()
null
if it could
not be determined. If you also want local tracked branches use
getTrackingBranch()
instead.public boolean isRemoteLocal()
true
if the "remote" setting points to the local
repository (with "."), false otherwisepublic java.lang.String getRemote()
null
if not definedpublic java.lang.String getMerge()
null
if not definedpublic boolean isRebase()
true
if the branch is configured to be rebasedpublic BranchConfig.BranchRebaseMode getRebaseMode()
BranchConfig.BranchRebaseMode
private java.lang.String findRemoteTrackingBranch(java.lang.String remote, java.lang.String mergeRef)
remote
- Remote namemergeRef
- merge Ref of the local branch tracking the remote tracking
branchprivate java.lang.String getRemoteOrDefault()