Search in sources :

Example 1 with DeleteBranchOperation

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();
}
Also used : DeleteBranchOperation(org.eclipse.egit.core.op.DeleteBranchOperation)

Example 2 with DeleteBranchOperation

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);
    }
}
Also used : Ref(org.eclipse.jgit.lib.Ref) SubMonitor(org.eclipse.core.runtime.SubMonitor) DeleteBranchOperation(org.eclipse.egit.core.op.DeleteBranchOperation) IOException(java.io.IOException)

Example 3 with DeleteBranchOperation

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();
}
Also used : DeleteBranchOperation(org.eclipse.egit.core.op.DeleteBranchOperation)

Example 4 with DeleteBranchOperation

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();
}
Also used : DeleteBranchOperation(org.eclipse.egit.core.op.DeleteBranchOperation)

Aggregations

DeleteBranchOperation (org.eclipse.egit.core.op.DeleteBranchOperation)4 IOException (java.io.IOException)1 SubMonitor (org.eclipse.core.runtime.SubMonitor)1 Ref (org.eclipse.jgit.lib.Ref)1