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

import com.atlassian.bitbucket.mesh.git.ref.Branch;

import javax.annotation.Nonnull;

public interface MergeManager {

    /**
     * @param parameters parameters describing the merge to perform
     * @return the merge hash
     */
    @Nonnull
    String merge(@Nonnull MergeParameters parameters);

    /**
     * @param parameters parameters describing the merge to dry-run
     */
    void tryMerge(@Nonnull MergeParameters parameters);

    /**
     * @param parameters parameters describing the ref to update
     * @param mergeHash  the merge hash for updating the ref
     * @return the updated branch
     */
    @Nonnull
    Branch updateRef(@Nonnull MergeParameters parameters, @Nonnull String mergeHash);
}