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
This commit is contained in:
Mikael Karlsson 2012-05-18 22:07:50 +02:00
parent 28d48b87ad
commit 15147a273f
1 changed files with 6 additions and 1 deletions

View File

@ -94,7 +94,12 @@ protected void run() throws NoHeadException, NoMessageException,
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())