def _add_file_to_tar(root, path, tar, arcname=None):
    """
    :param root:
        Root working directory.
    :param path:
        File path.
    :param tar:
        Open :class:`tarfile.TarFile` object to add the ``files`` to.
    """
    # TODO(larsbutler): document ``arcname``
    LOG.info('adding %s' % path)
    path = os.path.join(root, path)
    relpath = os.path.relpath(path, root)
    if arcname is None:
        # In the archive, give the file the same name and path.
        arcname = relpath
    tar.add(path, arcname=arcname)