Handle packed refs with no trailing newline