diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-16 18:02:07 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-17 00:43:39 +0100 |
commit | cced9395045664b13c76f547edfdd7451507230c (patch) | |
tree | 1f54fdc8e4089e710c7a5dcda0f122186919c342 /org.eclipse.jgit.pgm | |
parent | 137e91a4654b4f516d1f82885c669e14473dbfd6 (diff) | |
download | jgit-cced9395045664b13c76f547edfdd7451507230c.tar.gz jgit-cced9395045664b13c76f547edfdd7451507230c.zip |
pgm: Handle GitAPIException in Add 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: I02940bdc1645c1d5e0abeeb4f1bafde1b8c54a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java index 08a9f48c04..9ecbbf1375 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java @@ -48,6 +48,7 @@ import java.util.List; import org.eclipse.jgit.api.AddCommand; import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; @@ -69,6 +70,8 @@ class Add extends TextBuiltin { for (String p : filepatterns) addCmd.addFilepattern(p); addCmd.call(); + } catch (GitAPIException e) { + throw die(e.getMessage(), e); } } } |