package com.atlassian.bitbucket.mesh.git.builder.init;

import com.atlassian.bitbucket.mesh.git.builder.GitProcess;
import com.atlassian.bitbucket.mesh.git.builder.GitProcessBuilderSupport;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.nio.file.Path;

public interface GitInitBuilder extends GitProcessBuilderSupport<GitInitBuilder> {

    @Nonnull
    GitInitBuilder bare(boolean value);

    @Nonnull
    GitProcess<Void> build();

    /**
     * Specifies the directory which should be initialized for use as a Git repository. The directory
     * may exist already, but if it doesn't it will be created by {@code git init}.
     *
     * @param value the new repository's location on disk
     * @return {@code this}
     */
    @Nonnull
    GitInitBuilder directory(@Nonnull Path value);

    @Nonnull
    GitInitBuilder quiet(boolean value);

    @Nonnull
    GitInitBuilder shared(@Nullable String value);

    /**
     * Sets the {@code --template} path to be used when initializing the repository on disk. The Git
     * distribution includes its own template, which can be overridden by using this flag.
     *
     * @param value the {@code --template} path, or {@code null} to clear the flag
     * @return {@code this}
     */
    @Nonnull
    GitInitBuilder template(@Nullable Path value);
}
