repack_without_ref(): write peeled refs in the rewritten file