package com.atlassian.bitbucket.mesh.git.exception;

import com.atlassian.bitbucket.mesh.rpc.v1.RpcEmptyRebaseMerge;
import com.atlassian.bitbucket.mesh.rpc.v1.RpcGitError;

import javax.annotation.Nonnull;

public class EmptyRebaseMergeException extends MergeException {

    public EmptyRebaseMergeException() {
        super("The target branch includes identical changes; rebase discarded all incoming commits");
    }

    @Nonnull
    @Override
    public RpcGitError toError() {
        return RpcGitError.newBuilder()
                .setEmptyRebaseMerge(RpcEmptyRebaseMerge.getDefaultInstance())
                .build();
    }
}
