Browse Source

pgm: Handle GitAPIException in Fetch 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: I043838143df7280351186ee1bcca4d1cc4832257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
fe52e2fb8e
  1. 3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java

3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java

@ -51,6 +51,7 @@ import java.util.List;
import org.eclipse.jgit.api.FetchCommand; import org.eclipse.jgit.api.FetchCommand;
import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.SubmoduleConfig.FetchRecurseSubmodulesMode; import org.eclipse.jgit.lib.SubmoduleConfig.FetchRecurseSubmodulesMode;
import org.eclipse.jgit.lib.TextProgressMonitor; import org.eclipse.jgit.lib.TextProgressMonitor;
@ -168,6 +169,8 @@ class Fetch extends AbstractFetchCommand implements FetchCommand.Callback {
return; return;
showFetchResult(result); showFetchResult(result);
} catch (GitAPIException e) {
throw die(e.getMessage(), e);
} }
} }

Loading…
Cancel
Save