public class DeleteBranchCommand extends GitCommand<java.util.List<java.lang.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 |
|---|---|
java.util.List<java.lang.String> |
call()
Executes the command
|
DeleteBranchCommand |
setBranchNames(java.lang.String... branchnames) |
DeleteBranchCommand |
setForce(boolean force) |
checkCallable, getRepository, setCallableprotected DeleteBranchCommand(Repository repo)
repo - public java.util.List<java.lang.String> call()
throws GitAPIException,
NotMergedException,
CannotDeleteCurrentBranchException
GitCommandcall in interface java.util.concurrent.Callable<java.util.List<java.lang.String>>call in class GitCommand<java.util.List<java.lang.String>>NotMergedException - when trying to delete a branch which has not been merged into
the currently checked out branch without forceCannotDeleteCurrentBranchExceptionGitAPIException - or subclass thereof when an error occurspublic DeleteBranchCommand setBranchNames(java.lang.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 © 2012. All Rights Reserved.