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

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

Introduction

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

Prototype

@Nullable
public String readSquashCommitMsg() throws IOException 

Source Link

Document

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

Usage

From source file:org.eclipse.egit.gitflow.ui.internal.actions.FeatureFinishHandler.java

License:Open Source License

private void rewordCommitMessage(Shell activeShell, final GitFlowRepository gfRepo)
        throws CoreException, IOException {
    Repository repository = gfRepo.getRepository();
    CommitHelper commitHelper = new CommitHelper(repository);

    CommitMessageEditorDialog messageEditorDialog = new CommitMessageEditorDialog(activeShell,
            repository.readSquashCommitMsg(), UIText.FeatureFinishHandler_rewordSquashedCommitMessage);

    if (Window.OK == messageEditorDialog.open()) {
        String commitMessage = stripCommentLines(messageEditorDialog.getCommitMessage());
        CommitOperation commitOperation = new CommitOperation(repository, commitHelper.getAuthor(),
                commitHelper.getCommitter(), commitMessage);
        commitOperation.execute(null);//www  .  ja v a 2s .c o  m
    }
}