pgm: Handle IOException in IndexPack 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: Ie8a8388daecb0500f04197462210606c42f143c1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
152e4b43a3
commit
8b15ff57c8
|
@ -45,6 +45,7 @@
|
|||
package org.eclipse.jgit.pgm;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser;
|
||||
import org.eclipse.jgit.lib.ObjectInserter;
|
||||
|
@ -62,7 +63,7 @@ class IndexPack extends TextBuiltin {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected void run() throws Exception {
|
||||
protected void run() {
|
||||
BufferedInputStream in = new BufferedInputStream(ins);
|
||||
try (ObjectInserter inserter = db.newObjectInserter()) {
|
||||
PackParser p = inserter.newPackParser(in);
|
||||
|
@ -73,6 +74,8 @@ protected void run() throws Exception {
|
|||
}
|
||||
p.parse(new TextProgressMonitor(errw));
|
||||
inserter.flush();
|
||||
} catch (IOException e) {
|
||||
throw die(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue