def get_tree_url(ref, repository_url=None):
    """ Get a link for a ref (commit, branch or tag) for the repository. """
    return '{repository_url}/tree/{ref}'.format(repository_url=
        repository_url, ref=ref) if repository_url else None
