def find_ref_clone(repo_name):
    git_ref_path = e('${GIT_REF_PATH}')
    if git_ref_path:
        for path in git_ref_path.split(':'):
            candidate = os.path.join(path, repo_name)
            if is_git_repo(candidate):
                return candidate
    return None
See if there's an existing clone to use as a reference.
dataset/ETHPy150Open freenas/freenas-build/build/tools/checkout.py/find_ref_clone