package com.atlassian.stash.internal.repository.sync.rest;

import com.atlassian.bitbucket.rest.RestErrorMessage;
import com.atlassian.bitbucket.scm.git.command.merge.GitMergeException;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;

/**
 * @since 2.6
 */
public class RestMergeErrorMessage extends RestErrorMessage {

    public RestMergeErrorMessage(GitMergeException exception) {
        super(exception);

        put("conflicts", ImmutableList.copyOf(Lists.transform(exception.getConflicts(), RestMergeConflict.REST_TRANSFORM)));
    }
}
