Fix break when publishing an empty repo

Maybe add a docstring to this function? The argument behavior that test_file is not a full path, but the name of the file only may be useful. I'm 50/50 on if this should be done or not.