From 15147a273fc9085ca3cf459dec42f7a88b22ffbf Mon Sep 17 00:00:00 2001 From: Mikael Karlsson Date: Fri, 18 May 2012 22:07:50 +0200 Subject: [PATCH] Add user friendly output from jgit commit command 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 --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 cc7539b98..dccf33de0 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())