use of org.eclipse.che.api.git.shared.CheckoutRequest in project che by eclipse.
the class BranchPresenter method onCheckoutClicked.
/** {@inheritDoc} */
@Override
public void onCheckoutClicked() {
final CheckoutRequest checkoutRequest = dtoFactory.createDto(CheckoutRequest.class);
if (selectedBranch.isRemote()) {
checkoutRequest.setTrackBranch(selectedBranch.getDisplayName());
} else {
checkoutRequest.setName(selectedBranch.getDisplayName());
}
service.checkout(appContext.getDevMachine(), project.getLocation(), checkoutRequest).then(new Operation<Void>() {
@Override
public void apply(Void ignored) throws OperationException {
getBranches();
project.synchronize();
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
handleError(error.getCause(), BRANCH_CHECKOUT_COMMAND_NAME);
}
});
}
Aggregations