diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java index 6318a633c..d319759ed 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java @@ -56,15 +56,19 @@ import org.eclipse.jgit.lib.RefComparator; class ShowRef extends TextBuiltin { /** {@inheritDoc} */ @Override - protected void run() throws Exception { - for (Ref r : getSortedRefs()) { - show(r.getObjectId(), r.getName()); - if (r.getPeeledObjectId() != null) - show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$ + protected void run() { + try { + for (Ref r : getSortedRefs()) { + show(r.getObjectId(), r.getName()); + if (r.getPeeledObjectId() != null) + show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$ + } + } catch (IOException e) { + throw die(e.getMessage(), e); } } - private Iterable getSortedRefs() throws Exception { + private Iterable getSortedRefs() throws IOException { List all = db.getRefDatabase().getRefs(); // TODO(jrn) check if we can reintroduce fast-path by e.g. implementing // SortedList