Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = (IStructuredSelection) HandlerUtil .getCurrentSelection(event); final Repository repository = SelectionUtils.getRepository(selection); final GitFlowRepository gfRepo = new GitFlowRepository(repository); final List<Ref> refs = gfRepo.getFeatureBranches(); AbstractSelectionDialog<Ref> dialog = new AbstractSelectionDialog<Ref>( HandlerUtil.getActiveShell(event), refs, UIText.FeatureCheckoutHandler_selectFeature, UIText.FeatureCheckoutHandler_localFeatures) { @Override protected String getPrefix() { return R_HEADS + gfRepo.getFeaturePrefix(); } }; if (dialog.open() != Window.OK) { return null; } final Ref ref = dialog.getSelectedNode(); <START> UIJob trackingJob <END> = new UIJob( UIText.FeatureCheckoutHandler_checkingOutFeature) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { String featureName = gfRepo.getFeatureBranchName(ref); FeatureCheckoutOperation checkoutOperation = new FeatureCheckoutOperation( gfRepo, featureName); checkoutOperation.execute(monitor); CheckoutResult result = checkoutOperation.getResult(); if (!CheckoutResult.Status.OK.equals(result.getStatus())) { Shell shell = getDisplay().getActiveShell(); if (!handleUncommittedFiles(gfRepo.getRepository(), shell, repository.getWorkTree().getName())) { return Status.CANCEL_STATUS; } else { checkoutOperation.execute(monitor); } } } catch (CoreException e) { return error(e.getMessage(), e); } catch (GitAPIException e) { throw new RuntimeException(e); } return Status.OK_STATUS; } }; trackingJob.setUser(true); trackingJob.schedule(); return null; }</code><technical_language>checkout potentially run a long time executed a large repository BranchOperationUI runs checkout in a workspaceJob run checkout in background prevent premature UI refreshes (see commit 786698088)</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = (IStructuredSelection) HandlerUtil .getCurrentSelection(event); final Repository repository = SelectionUtils.getRepository(selection); final GitFlowRepository gfRepo = new GitFlowRepository(repository); final List<Ref> refs = gfRepo.getFeatureBranches(); AbstractGitFlowBranchSelectionDialog<Ref> dialog = new AbstractGitFlowBranchSelectionDialog<Ref>( HandlerUtil.getActiveShell(event), refs, UIText.FeatureCheckoutHandler_selectFeature, UIText.FeatureCheckoutHandler_localFeatures) { @Override protected String getPrefix() { return R_HEADS + gfRepo.getFeaturePrefix(); } }; if (dialog.open() != Window.OK) { return null; } final Ref ref = dialog.getSelectedNode(); UIJob trackingJob = new UIJob( UIText.FeatureCheckoutHandler_checkingOutFeature) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { try { String featureName = gfRepo.getFeatureBranchName(ref); FeatureCheckoutOperation checkoutOperation = new FeatureCheckoutOperation( gfRepo, featureName); checkoutOperation.execute(monitor); CheckoutResult result = checkoutOperation.getResult(); if (!CheckoutResult.Status.OK.equals(result.getStatus())) { Shell shell = getDisplay().getActiveShell(); if (!handleUncommittedFiles(gfRepo.getRepository(), shell, repository.getWorkTree().getName())) { return Status.CANCEL_STATUS; } else { checkoutOperation.execute(monitor); } } } catch (CoreException e) { return error(e.getMessage(), e); } catch (GitAPIException e) { throw new RuntimeException(e); } return Status.OK_STATUS; } }; trackingJob.setUser(true); trackingJob.schedule(); return null; }