def find_asset_by_code(asset_finder, asset_code, all_commits):
    """
    Find an asset by the asset code.

    :param asset_finder: The cached asset finder to use.
    :param asset_code: The code of the asset to search for.
    :param all_commits: All the commits to look for.
    :returns: A pair containing the result from the 'test' and the commit.
    """
    asset_finder.search(code=asset_code)
    for commit in all_commits:
        res = asset_finder.test(commit.tree)
        if res:
            return res, commit
