public void push() {
   final Git git = new Git(getRepository());
   try {
     for (final PushResult result : git.push().setPushAll().call()) {
       LOGGER.info(result.getMessages());
     }
   } catch (final Exception e) {
     throw new IllegalStateException("Unable to perform push operation ", e);
   }
 }
Example #2
0
 protected RevCommit commitThenPush(Git git, String branch, CommitCommand commit)
     throws Exception {
   RevCommit answer = commit.call();
   if (LOG.isDebugEnabled()) {
     LOG.debug("Committed " + answer.getId() + " " + answer.getFullMessage());
   }
   if (isPushOnCommit()) {
     Iterable<PushResult> results = doPush(git);
     for (PushResult result : results) {
       if (LOG.isDebugEnabled()) {
         LOG.debug(
             "Pushed "
                 + result.getMessages()
                 + " "
                 + result.getURI()
                 + " branch: "
                 + branch
                 + " updates: "
                 + toString(result.getRemoteUpdates()));
       }
     }
   }
   return answer;
 }