use of org.eclipse.egit.core.op.DeleteBranchOperation in project egit by eclipse.
the class DeleteBranchDialog method deleteBranch.
private int deleteBranch(final Set<Ref> ref, boolean force) throws CoreException {
DeleteBranchOperation dbop = new DeleteBranchOperation(repo, ref, force);
dbop.execute(null);
return dbop.getStatus();
}
use of org.eclipse.egit.core.op.DeleteBranchOperation in project egit by eclipse.
the class GitFlowOperation method finish.
/**
* git flow * finish
*
* @param monitor
* @param branchName
* @param squash
* @param fastForwardSingleCommit Has no effect if {@code squash} is true.
* @param keepBranch
* @throws CoreException
* @since 4.1
*/
protected void finish(IProgressMonitor monitor, String branchName, boolean squash, boolean keepBranch, boolean fastForwardSingleCommit) throws CoreException {
try {
SubMonitor progress = SubMonitor.convert(monitor, 2);
mergeResult = mergeTo(progress.newChild(1), branchName, repository.getConfig().getDevelop(), squash, fastForwardSingleCommit);
if (!mergeResult.getMergeStatus().isSuccessful()) {
return;
}
Ref branch = repository.findBranch(branchName);
if (branch == null) {
throw new IllegalStateException(String.format(CoreText.GitFlowOperation_branchMissing, branchName));
}
boolean forceDelete = squash;
if (!keepBranch) {
new DeleteBranchOperation(repository.getRepository(), branch, forceDelete).execute(progress.newChild(1));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of org.eclipse.egit.core.op.DeleteBranchOperation in project egit by eclipse.
the class DeleteBranchOnCommitHandler method deleteBranch.
private int deleteBranch(Repository repo, final Ref ref, boolean force) throws CoreException {
DeleteBranchOperation dbop = new DeleteBranchOperation(repo, ref, force);
dbop.execute(null);
return dbop.getStatus();
}
use of org.eclipse.egit.core.op.DeleteBranchOperation in project egit by eclipse.
the class DeleteBranchCommand method deleteBranch.
private int deleteBranch(final Repository repo, final Ref ref, boolean force) throws CoreException {
DeleteBranchOperation dbop = new DeleteBranchOperation(repo, ref, force);
dbop.execute(null);
return dbop.getStatus();
}
Aggregations