pack: move {,re}prepare_packed_git and approximate_object_count