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

import com.atlassian.bitbucket.mesh.git.builder.GitProcessBuilder;

import javax.annotation.Nonnull;

import static java.util.Objects.requireNonNull;

public class DefaultGitBranch implements GitBranch {

    private final GitProcessBuilder builder;

    public DefaultGitBranch(GitProcessBuilder builder) {
        this.builder = requireNonNull(builder, "builder").command("branch");
    }

    @Nonnull
    @Override
    public GitBranchCreateBuilder create(@Nonnull String name) {
        return new DefaultGitBranchCreateBuilder(builder, name);
    }

    @Nonnull
    @Override
    public GitBranchDeleteBuilder delete(@Nonnull String name) {
        return new DefaultGitBranchDeleteBuilder(builder, name);
    }
}
