Search in sources :

Example 1 with IGitRebaseParameters

use of com.virtuslab.gitmachete.backend.api.IGitRebaseParameters in project git-machete-intellij-plugin by VirtusLab.

the class NonRootManagedBranchSnapshot method getParametersForRebaseOntoParent.

@Override
public IGitRebaseParameters getParametersForRebaseOntoParent() throws GitMacheteMissingForkPointException {
    LOG.debug(() -> "Entering: branch = '${getName()}'");
    if (forkPoint == null) {
        throw new GitMacheteMissingForkPointException("Cannot get fork point for branch '${getName()}'");
    }
    val newBaseBranch = getParent();
    LOG.debug(() -> "Inferred rebase parameters: currentBranch = ${getName()}, " + "newBaseCommit = ${newBaseBranch.getPointedCommit().getHash()}, " + "forkPointCommit = ${forkPoint != null ? forkPoint.getHash() : null}");
    return new GitRebaseParameters(/* currentBranch */
    this, newBaseBranch, forkPoint);
}
Also used : lombok.val(lombok.val) IGitRebaseParameters(com.virtuslab.gitmachete.backend.api.IGitRebaseParameters) GitMacheteMissingForkPointException(com.virtuslab.gitmachete.backend.api.GitMacheteMissingForkPointException)

Aggregations

GitMacheteMissingForkPointException (com.virtuslab.gitmachete.backend.api.GitMacheteMissingForkPointException)1 IGitRebaseParameters (com.virtuslab.gitmachete.backend.api.IGitRebaseParameters)1 lombok.val (lombok.val)1