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

import com.atlassian.bitbucket.scm.git.command.GitScmCommandBuilder;
import com.atlassian.bitbucket.scm.git.command.clone.GitClone;
import com.atlassian.bitbucket.scm.git.command.clone.GitCloneBuilder;

import javax.annotation.Nonnull;

/**
 * @since 1.3
 */
public class DefaultGitClone implements GitClone {

    private final GitScmCommandBuilder builder;

    public DefaultGitClone(GitScmCommandBuilder builder) {
        this.builder = builder.command("clone");
    }

    @Nonnull
    @Override
    public GitCloneBuilder bare() {
        return new DefaultGitCloneBuilder(builder, CloneFormat.BARE);
    }

    @Nonnull
    @Override
    public GitCloneBuilder mirror() {
        return new DefaultGitCloneBuilder(builder, CloneFormat.MIRROR);
    }

    @Nonnull
    @Override
    public GitCloneBuilder normal() {
        return new DefaultGitCloneBuilder(builder, CloneFormat.NORMAL);
    }
}
