List of usage examples for org.eclipse.jgit.api CommitCommand getAuthor
public PersonIdent getAuthor()
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(); }