public class DeleteBranchCommand extends GitCommand<List<String>>
call()
is a list with the (full) names of the deleted
branches.
Note that we don't have a setter corresponding to the -r option; remote
tracking branches are simply deleted just like local branches.repo
Modifier | Constructor and Description |
---|---|
protected |
DeleteBranchCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
List<String> |
call()
Executes the command
|
DeleteBranchCommand |
setBranchNames(String... branchnames) |
DeleteBranchCommand |
setForce(boolean force) |
checkCallable, getRepository, setCallable
protected DeleteBranchCommand(Repository repo)
repo
- public List<String> call() throws GitAPIException, NotMergedException, CannotDeleteCurrentBranchException
GitCommand
call
in interface Callable<List<String>>
call
in class GitCommand<List<String>>
NotMergedException
- when trying to delete a branch which has not been merged into
the currently checked out branch without forceCannotDeleteCurrentBranchException
GitAPIException
- or subclass thereof when an error occurspublic DeleteBranchCommand setBranchNames(String... branchnames)
branchnames
- the names of the branches to delete; if not set, this will do
nothing; invalid branch names will simply be ignoredpublic DeleteBranchCommand setForce(boolean force)
force
- true
corresponds to the -D option,
false
to the -d option (default) false
a check will be performed whether the
branch to be deleted is already merged into the current branch
and deletion will be refused in this caseCopyright © 2014. All rights reserved.