package com.atlassian.stash.internal.scm.git.command.merge;

import com.atlassian.bitbucket.i18n.I18nService;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.scm.git.GitScmConfig;
import com.atlassian.bitbucket.scm.git.command.GitScmCommandBuilder;
import com.atlassian.bitbucket.scm.git.command.merge.GitMerge;
import com.atlassian.bitbucket.scm.git.command.merge.GitMergeBuilder;
import com.atlassian.bitbucket.scm.git.command.merge.GitSquashMergeBuilder;

import javax.annotation.Nonnull;

/**
 * @since 2.1
 */
public class DefaultGitMerge implements GitMerge {

    private final GitScmCommandBuilder builder;
    private final GitScmConfig config;
    private final I18nService i18nService;
    private final Repository repository;

    public DefaultGitMerge(GitScmCommandBuilder builder, GitScmConfig config,
                           I18nService i18nService, Repository repository) {
        this.builder = builder;
        this.config = config;
        this.i18nService = i18nService;
        this.repository = repository;
    }

    @Nonnull
    @Override
    public GitMergeBuilder normal() {
        return new DefaultGitMergeBuilder(builder, config, i18nService, repository);
    }

    @Nonnull
    @Override
    public GitSquashMergeBuilder squash() {
        return new DefaultGitSquashMergeBuilder(builder, config, i18nService, repository);
    }
}
