]> source.dussan.org Git - jgit.git/commitdiff
Add user friendly output from jgit commit command 34/6034/1
authorMikael Karlsson <mmmicke@gmail.com>
Fri, 18 May 2012 20:07:50 +0000 (22:07 +0200)
committerMikael Karlsson <mmmicke@gmail.com>
Fri, 18 May 2012 20:07:50 +0000 (22:07 +0200)
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

index cc7539b98e8e833e79d8b6a62f331df5206fc98d..dccf33de08ff919d3db817df1cf41d7f300c4ecf 100644 (file)
@@ -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())