Example usage for org.eclipse.jgit.api MergeCommand setFastForward

List of usage examples for org.eclipse.jgit.api MergeCommand setFastForward

Introduction

In this page you can find the example usage for org.eclipse.jgit.api MergeCommand setFastForward.

Prototype

public MergeCommand setFastForward(@Nullable FastForwardMode fastForwardMode) 

Source Link

Document

Sets the fast forward mode.

Usage

From source file:org.codehaus.mojo.versions.BumpMojo.java

License:Apache License

void gitMergeNFF(String c, String m) throws MojoExecutionException {
    try {/*from  w w  w .j  a va2s . co m*/
        MergeCommand ff = git.merge();
        ff.setCommit(false);
        ff.setFastForward(FastForwardMode.NO_FF);
        ff.include(git.getRepository().getRef(m));
        MergeResult f = ff.call();
        if (!f.getMergeStatus().isSuccessful()) {
            throw new MojoExecutionException(f.getMergeStatus().toString());
        }
        git.commit().setAll(true).setMessage(c).call();
    } catch (GitAPIException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    } catch (IOException e) {
        throw new MojoExecutionException(e.getMessage(), e);
    }
}