private void commitAll() throws CoreException { Git git = new Git(repo); try { CommitCommand commitCommand = git.commit(); setAuthorAndCommitter(commitCommand); commit = commitCommand.setAll(true).setMessage(message).setInsertChangeId(createChangeId).call(); } catch (JGitInternalException e) { throw new CoreException("An internal error occurred", e); } catch (GitAPIException e) { throw new CoreException(e.getLocalizedMessage(), e); } }
private void commit() throws CoreException { Git git = new Git(repo); try { CommitCommand commitCommand = git.commit(); setAuthorAndCommitter(commitCommand); commitCommand.setAmend(amending).setMessage(message).setInsertChangeId(createChangeId); if (!commitIndex) for (String path : commitFileList) commitCommand.setOnly(path); commit = commitCommand.call(); } catch (JGitInternalException e) { if ("No changes".equals(JGitText.get().emptyCommit)) { ifNoChanges = true; } } catch (Exception e) { throw new CoreException("An internal error occurred", e); } }