Example usage for org.eclipse.jgit.lib Repository readCherryPickHead

List of usage examples for org.eclipse.jgit.lib Repository readCherryPickHead

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib Repository readCherryPickHead.

Prototype

@Nullable
public ObjectId readCherryPickHead() throws IOException, NoWorkTreeException 

Source Link

Document

Return the information stored in the file $GIT_DIR/CHERRY_PICK_HEAD.

Usage

From source file:org.eclipse.egit.ui.internal.commit.CommitHelper.java

License:Open Source License

private static String getCherryPickOriginalAuthor(Repository mergeRepository) {
    try {//from   w  w  w .ja va2s .  co  m
        ObjectId cherryPickHead = mergeRepository.readCherryPickHead();
        PersonIdent author = new RevWalk(mergeRepository).parseCommit(cherryPickHead).getAuthorIdent();
        return author.getName() + " <" + author.getEmailAddress() + ">"; //$NON-NLS-1$//$NON-NLS-2$
    } catch (IOException e) {
        Activator.handleError(UIText.CommitAction_errorRetrievingCommit, e, true);
        throw new IllegalStateException(e);
    }
}

From source file:org.flowerplatform.web.git.operation.CommitOperation.java

License:Open Source License

private String getCherryPickOriginalAuthor(Repository mergeRepository) {
    try {/*from   w w  w. j  a  v a  2 s  .  co m*/
        ObjectId cherryPickHead = mergeRepository.readCherryPickHead();
        PersonIdent author = new RevWalk(mergeRepository).parseCommit(cherryPickHead).getAuthorIdent();
        return author.getName() + " <" + author.getEmailAddress() + ">";
    } catch (IOException e) {
        return null;
    }
}