def METHOD_NAME(lib, credentials, repo_settings):
    if repo_settings is None:
        return None
    if repo_settings.oldName is None:
        repo_settings.oldName = repo_settings.name
    if repo_settings.owner is None:
        repo_settings.owner = repo_settings.oldOwner
    if repo_settings.oldOwner is None:
        repo_settings.oldOwner = repo_settings.owner
    if not lib.repository_exists(repo_settings):
        if repo_settings.fork:
            response = lib.fork(repo_settings)
            if not response.ok:
                return "Failed to fork repository"
        else:
            response = lib.create_repository(repo_settings)
            if not response.ok:
                return "Failed to create repository"
    response = lib.library_specific(credentials, repo_settings)
    if not response.ok:
        return response.msg
    return None