aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Karlsson2012-05-18 16:07:50 (EDT)
committerMikael Karlsson2012-05-18 16:07:50 (EDT)
commit15147a273fc9085ca3cf459dec42f7a88b22ffbf (patch)
tree2f99ce04ebedec9452cc78ec52b49d4536a603c2
parent28d48b87ad41153ba3d53e75258e2bbbaaa0ab44 (diff)
downloadjgit-15147a273fc9085ca3cf459dec42f7a88b22ffbf.zip
jgit-15147a273fc9085ca3cf459dec42f7a88b22ffbf.tar.gz
jgit-15147a273fc9085ca3cf459dec42f7a88b22ffbf.tar.bz2
Add user friendly output from jgit commit commandrefs/changes/34/6034/1
Instead of printing the stack trace from the JGitInternalException thrown from CommitMessage.call(), print just the exception message, using the Die exception. Change-Id: I9ec3eb02eb001813fa15ac6f90a606223dcdafdc
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
index cc7539b..dccf33d 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
@@ -94,7 +94,12 @@ class Commit extends TextBuiltin {
commitCmd.setAmend(amend);
commitCmd.setAll(all);
Ref head = db.getRef(Constants.HEAD);
- RevCommit commit = commitCmd.call();
+ RevCommit commit;
+ try {
+ commit = commitCmd.call();
+ } catch (JGitInternalException e) {
+ throw die(e.getMessage());
+ }
String branchName;
if (!head.isSymbolic())