Cleanup code around optimization in git-refs
'git refs optimize' which was added recently in db0babf9 (Merge branch 'ms/refs-optimize', 2025-10-02) adds code in the refs subsystem which contains both 'pack-refs' and 'optimize' functions, which are one and the same.
It would be nice to clean this up.