Browse Source

pgm: Handle exceptions in Log command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Ibca80cf2195db01298f2b95f507cfa3de2f403e7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
64386cbfb7
  1. 4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java

4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java

@ -193,7 +193,7 @@ class Log extends RevWalkTextBuiltin {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() {
diffFmt.setRepository(db); diffFmt.setRepository(db);
try { try {
diffFmt.setPathFilter(pathFilter); diffFmt.setPathFilter(pathFilter);
@ -225,6 +225,8 @@ class Log extends RevWalkTextBuiltin {
.getAllRefsByPeeledObjectId(); .getAllRefsByPeeledObjectId();
super.run(); super.run();
} catch (Exception e) {
throw die(e.getMessage(), e);
} finally { } finally {
diffFmt.close(); diffFmt.close();
} }

Loading…
Cancel
Save