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

import com.atlassian.bitbucket.mesh.git.content.MinimalChange;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

@FunctionalInterface
public interface CommitCallback {

    /**
     * Receives a fully-populated {@link Commit commit} for processing.
     *
     * @param commit the commit
     * @param renameChange the rename change that was detected. Only provided if --follow-renames is set to
     *                     {@code true} and a single path is passed.
     * @return {@code true} if processing is done successfully, {@code false} otherwise.
     */
    boolean onCommit(@Nonnull Commit commit, @Nullable MinimalChange renameChange);
}
