package com.atlassian.bitbucket.mesh.git.merge;

import com.atlassian.bitbucket.mesh.git.porcelain.WorkTreeParameters;

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

public interface MergeStrategy {

    /**
     * Allows strategies to customize the {@link WorkTreeParameters.Builder}, which is initially prepared using
     * the {@link MergeParameters} describing the merge to be performed.
     *
     * @param builder the builder to customize
     * @return a customized builder, which may be the same instance or a new one but may not be {@code null}
     */
    @Nonnull
    WorkTreeParameters.Builder customizeWorkTree(@Nonnull WorkTreeParameters.Builder builder);

    /**
     * Performs the merge in the provided work tree.
     *
     * @param parameters parameters describing the merge to perform
     * @param workTree   the work tree to perform the merge in
     */
    void merge(@Nonnull MergeParameters parameters, @Nonnull Path workTree);
}
