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

import javax.annotation.Nonnull;

/**
 * A callback for receiving {@link CommitManager#streamLastModified modification data} for the files in a specified
 * directory, starting from a given commit.
 */
public interface LastModifiedCallback {

    /**
     * Receives the latest commit to modify a file in the directory.
     *
     * @param file         the file that was modified
     * @param latestCommit the latest commit to modify the file
     */
    void onFileModified(@Nonnull String file, @Nonnull Commit latestCommit);

    /**
     * Receives the latest commit to modify the <i>request</i> directory. This may match the latest commit for one
     * or more of the {@link #onFileModified modified files}, or it may not.
     *
     * @param latestCommit the latest commit to modify the request directory
     */
    void onLatestCommit(@Nonnull Commit latestCommit);
}
