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) |
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, setCallable
private 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>>
GitAPIException
private java.util.Collection<Ref> filterRefs(java.util.Collection<Ref> refs) throws RefNotFoundException, java.io.IOException
RefNotFoundException
java.io.IOException
public 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 name