diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java index be8ad374d..faa0f51d7 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java @@ -53,6 +53,7 @@ import java.util.List; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.PushCommand; +import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectReader; @@ -115,7 +116,7 @@ class Push extends TextBuiltin { /** {@inheritDoc} */ @Override - protected void run() throws Exception { + protected void run() { try (Git git = new Git(db)) { PushCommand push = git.push(); push.setDryRun(dryRun); @@ -140,6 +141,8 @@ class Push extends TextBuiltin { printPushResult(reader, result.getURI(), result); } } + } catch (GitAPIException | IOException e) { + throw die(e.getMessage(), e); } }