def METHOD_NAME(current_commit: str) -> None:
    logger.debug(f"Traversing {current_commit}")
    if current_commit in visited:
        logger.debug(f"Already visited, abandoning path")
        return
    visited.add(current_commit)
    on_commit(current_commit)
    # we must check **only** the first parent, as the merge commit should
    # contain the diff of the other, merged branches
    first_parent = get_parent_commit_ids(current_commit)[0]
    # we do need to check that we are still on our way to encountering the
    # 'old_commit' so as to avoid going all the way to the original commit
    # when the provided 'old_commit' is not on the main path.
    if first_parent == old_commit:
        logger.info(f"Succesfully reached target commit {old_commit}, done.")
        return
    elif is_ancestor(old_commit, first_parent):
        METHOD_NAME(first_parent)
    else:
        logger.warn(
            f"Abandoning path ending at {first_parent} since it does not have {old_commit} as ancestor."
        )
        return