Example usage for org.eclipse.jgit.api CommitCommand getAuthor

List of usage examples for org.eclipse.jgit.api CommitCommand getAuthor

Introduction

In this page you can find the example usage for org.eclipse.jgit.api CommitCommand getAuthor.

Prototype

public PersonIdent getAuthor() 

Source Link

Document

Get the author

Usage

From source file:org.eclipse.egit.core.test.TestRepository.java

License:Open Source License

/**
 * Commits the current index/*from  ww w. j a va 2s .co  m*/
 *
 * @param message
 *            commit message
 * @return commit object
 *
 * @throws NoHeadException
 * @throws NoMessageException
 * @throws UnmergedPathException
 * @throws ConcurrentRefUpdateException
 * @throws JGitInternalException
 * @throws WrongRepositoryStateException
 */
public RevCommit commit(String message) throws NoHeadException, NoMessageException, UnmergedPathException,
        ConcurrentRefUpdateException, JGitInternalException, WrongRepositoryStateException {
    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();
}

From source file:org.eclipse.emf.compare.diagram.papyrus.tests.egit.fixture.GitTestRepository.java

License:Open Source License

/**
 * Commits the current index./*from w  ww  .  j a  v  a 2s  .co m*/
 * 
 * @param message
 *            commit message
 * @return commit object
 */
public RevCommit commit(String message) throws Exception {
    Git git = new Git(repository);
    try {
        CommitCommand commitCommand = git.commit();
        commitCommand.setAuthor("J. Git", "j.git@egit.org");
        commitCommand.setCommitter(commitCommand.getAuthor());
        commitCommand.setMessage(message);
        return commitCommand.call();
    } finally {
        git.close();
    }
}

From source file:org.jboss.tools.openshift.egit.internal.test.util.TestRepository.java

License:Open Source License

/**
 * Commits the current index/*from  w  ww. j  a  v  a2s. c  o  m*/
 * 
 * @param message
 *            commit message
 * @return commit object
 * 
 * @throws UnmergedPathException
 * @throws JGitInternalException
 * @throws GitAPIException 
 * @throws UnmergedPathsException 
 */
public RevCommit commit(String message)
        throws UnmergedPathException, JGitInternalException, UnmergedPathsException, GitAPIException {
    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();
}