public class ListBranchCommand extends GitCommand<java.util.List<Ref>>
In case HEAD is detached (it points directly to a commit), it is also returned in the results.
| Modifier and Type | Class and Description |
|---|---|
static class |
ListBranchCommand.ListMode
The modes available for listing branches (corresponding to the -r and -a
options)
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
containsCommitish |
private ListBranchCommand.ListMode |
listMode |
repo| Modifier | Constructor and Description |
|---|---|
protected |
ListBranchCommand(Repository repo)
Constructor for ListBranchCommand.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Ref> |
call() |
private java.util.Collection<Ref> |
filterRefs(java.util.Collection<Ref> refs) |
private java.util.Collection<Ref> |
getRefs(java.lang.String prefix) |
ListBranchCommand |
setContains(java.lang.String containsCommitish)
If this is set, only the branches that contain the specified commit-ish
as an ancestor are returned.
|
ListBranchCommand |
setListMode(ListBranchCommand.ListMode listMode)
Set the list mode
|
checkCallable, getRepository, setCallableprivate ListBranchCommand.ListMode listMode
private java.lang.String containsCommitish
protected ListBranchCommand(Repository repo)
repo - a Repository object.public java.util.List<Ref> call() throws GitAPIException
Execute the command
call in interface java.util.concurrent.Callable<java.util.List<Ref>>call in class GitCommand<java.util.List<Ref>>GitAPIExceptionprivate java.util.Collection<Ref> filterRefs(java.util.Collection<Ref> refs) throws RefNotFoundException, java.io.IOException
RefNotFoundExceptionjava.io.IOExceptionpublic ListBranchCommand setListMode(ListBranchCommand.ListMode listMode)
listMode - optional: corresponds to the -r/-a options; by default, only
local branches will be listedpublic ListBranchCommand setContains(java.lang.String containsCommitish)
containsCommitish - a commit ID or ref nameprivate java.util.Collection<Ref> getRefs(java.lang.String prefix) throws java.io.IOException
java.io.IOException