Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.CommitCommand.call()


    commitCmd.setAmend(amend);
    commitCmd.setAll(all);
    Ref head = db.getRef(Constants.HEAD);
    RevCommit commit;
    try {
      commit = commitCmd.call();
    } catch (JGitInternalException e) {
      throw die(e.getMessage());
    }

    String branchName;
View Full Code Here


    if (author != null)
      commitCmd.setAuthor(new PersonIdent(author));
    if (message != null)
      commitCmd.setMessage(message);
    Ref head = db.getRef(Constants.HEAD);
    RevCommit commit = commitCmd.call();

    String branchName;
    if (!head.isSymbolic())
      branchName = CLIText.get().branchDetachedHEAD;
    else {
View Full Code Here

                UserInfo author = getAuthor( repo, git );
                UserInfo committer = getCommitter( repo, git );

                CommitCommand command = git.commit().setMessage( message ).setAuthor( author.name, author.email );
                command.setCommitter( committer.name, committer.email );
                RevCommit commitRev = command.call();

                getLogger().info( "commit done: " + commitRev.getShortMessage() );
                checkedInFiles = JGitUtils.getFilesInCommit( git.getRepository(), commitRev );
                if ( getLogger().isDebugEnabled() )
                {
View Full Code Here

            cmd.call();

            CommitCommand co = git.commit();
            co.setAuthor("Jenkow","noreply@jenkins-ci.org");
            co.setMessage(msg);
            co.call();
        } catch (GitAPIException e) {
            LOGGER.log(Level.WARNING, "Adding seeded jenkow-repository content to Git failed",e);
        }
  }
View Full Code Here

        if (author != null) {
            commitCommand
                .setAuthor(author.loginId, author.email)
                .setCommitter(author.loginId, author.email);
        }
        return commitCommand.call();
    }

    @Test
    public void checkout() throws IOException, GitAPIException {
        // Given
View Full Code Here

          .setMessage(message)
          .setInsertChangeId(createChangeId);
      if (!commitIndex)
        for(String path:commitFileList)
          commitCommand.setOnly(path);
      commit = commitCommand.call();
    } catch (Exception e) {
      throw new TeamException(
          CoreText.MergeOperation_InternalError, e);
    }
  }
View Full Code Here

    Git git = new Git(repository);
    CommitCommand commitCommand = git.commit();
    commitCommand.setAuthor("J. Git", "j.git@egit.org");
    commitCommand.setCommitter(commitCommand.getAuthor());
    commitCommand.setMessage(message);
    return commitCommand.call();
  }

  /**
   * Adds file to version control
   *
 
View Full Code Here

        CommitCommand commit = git.commit();
        commit.setAuthor(identification);
        commit.setCommitter(identification);
        commit.setMessage(message);
        try {
            commit.call();
        } catch (NoHeadException e) {
            throw new IllegalStateException("Unable to commit into Git repository", e);
        } catch (NoMessageException e) {
            throw new IllegalStateException("Unable to commit into Git repository", e);
        } catch (ConcurrentRefUpdateException e) {
View Full Code Here

    add.call();

    // execute the commit
    CommitCommand commit = git.commit();
    commit.setMessage(message);
    RevCommit revCommit = commit.call();

    if (!StringUtils.isEmpty(tagName) && !StringUtils.isEmpty(tagMessage)) {
      // tag the commit
      TagCommand tagCommand = git.tag();
      tagCommand.setName(tagName);
View Full Code Here

        CommitCommand commit = git.commit();
        PersonIdent moxie = new PersonIdent("Moxie", "moxie@localhost");
        commit.setAuthor(moxie);
        commit.setCommitter(moxie);
        commit.setMessage("Project structure created");
        commit.call();
      } catch (Exception e) {
        throw new MoxieException(e);
      }
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.