Source:
private void revalidateImpl(final RepositorySelection newRepoSelection) { if (label.isDisposed() || !isCurrentPage()) return; final ListRemoteOperation listRemoteOp; try { final URIish uri = newRepoSelection.getURI(); final Repository db = new FileRepository(new File("/tmp")); int timeout = Activator.getDefault().getPreferenceStore().getInt( UIPreferences.REMOTE_CONNECTION_TIMEOUT); listRemoteOp = new ListRemoteOperation(db, uri, timeout); if (credentials != null) { listRemoteOp .setCredentialsProvider(new UsernamePasswordCredentialsProvider( credentials.getUser(), credentials.getPassword())); } getContainer().run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { listRemoteOp.run(monitor); } }); } catch (InvocationTargetException e) { Throwable why = e.getCause(); transportError(why.getMessage()); ErrorDialog.openError(getShell(), UIText.SourceBranchPage_transportError, UIText.SourceBranchPage_cannotListBranches, new Status( IStatus.ERROR, Activator.getPluginId(), 0, why .getMessage(), why.getCause())); return; } catch (IOException e) { transportError(UIText.SourceBranchPage_cannotCreateTemp); return; } catch (InterruptedException e) { transportError(UIText.SourceBranchPage_remoteListingCancelled); return; } final Ref idHEAD = listRemoteOp.getRemoteRef(Constants.HEAD); head = null; for (final Ref r : listRemoteOp.getRemoteRefs()) { final String n = r.getName(); if (!n.startsWith(Constants.R_HEADS)) continue; availableRefs.add(r); if (idHEAD == null || head != null) continue; if (r.getObjectId().equals(idHEAD.getObjectId())) head = r; } Collections.sort(availableRefs, new Comparator<Ref>() { public int compare(final Ref o1, final Ref o2) { return o1.getName().compareTo(o2.getName()); } }); if (idHEAD != null && head == null) { head = idHEAD; availableRefs.add(0, idHEAD); } validatedRepoSelection = newRepoSelection; refsViewer.setInput(availableRefs); refsViewer.setAllChecked(true); checkPage(); checkForEmptyRepo(); }

Target:
private void revalidateImpl(final RepositorySelection newRepoSelection) { if (label.isDisposed() || !isCurrentPage()) return; final ListRemoteOperation listRemoteOp; try { final URIish uri = newRepoSelection.getURI(); final Repository db = new FileRepository(new File("/tmp")); int timeout = Activator.getDefault().getPreferenceStore().getInt( UIPreferences.REMOTE_CONNECTION_TIMEOUT); listRemoteOp = new ListRemoteOperation(db, uri, timeout); if (credentials != null) listRemoteOp .setCredentialsProvider(new UsernamePasswordCredentialsProvider( credentials.getUser(), credentials.getPassword())); getContainer().run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { listRemoteOp.run(monitor); } }); } catch (InvocationTargetException e) { Throwable why = e.getCause(); transportError(why.getMessage()); ErrorDialog.openError(getShell(), UIText.SourceBranchPage_transportError, UIText.SourceBranchPage_cannotListBranches, new Status( IStatus.ERROR, Activator.getPluginId(), 0, why .getMessage(), why.getCause())); return; } catch (IOException e) { transportError(UIText.SourceBranchPage_cannotCreateTemp); return; } catch (InterruptedException e) { transportError(UIText.SourceBranchPage_remoteListingCancelled); return; } final Ref idHEAD = listRemoteOp.getRemoteRef(Constants.HEAD); head = null; for (final Ref r : listRemoteOp.getRemoteRefs()) { final String n = r.getName(); if (!n.startsWith(Constants.R_HEADS)) continue; availableRefs.add(r); if (idHEAD == null || head != null) continue; if (r.getObjectId().equals(idHEAD.getObjectId())) head = r; } Collections.sort(availableRefs, new Comparator<Ref>() { public int compare(final Ref o1, final Ref o2) { return o1.getName().compareTo(o2.getName()); } }); if (idHEAD != null && head == null) { head = idHEAD; availableRefs.add(0, idHEAD); } validatedRepoSelection = newRepoSelection; refsViewer.setInput(availableRefs); refsViewer.setAllChecked(true); checkPage(); checkForEmptyRepo(); }