def METHOD_NAME(commit, cwl_files_commits_map, cwl_files):
    if len(cwl_files) != 1:
        return
    path = cwl_files[0]
    existing_commit = cwl_files_commits_map.get(path)
    if existing_commit is None:
        cwl_files_commits_map[path] = commit
    elif existing_commit.compare_to(commit) < 0:  # existing commit is older
        cwl_files_commits_map[path] = commit