archive: simplify refname handling