Re-enable Git protocol v2
Problem to solve
The Git wire protocol version 1 is not bandwidth efficient when large numbers of refs exist on the server, and are therfore advertised. This can significantly increase the data transferred from the server to the client for small operations.
Early versions of Git supporting protocol v2 had an issue where hidden refs were not respected https://gitlab.com/gitlab-org/gitlab-ce/issues/55769, creating performance and security problems. GitLab disabled support for protocol v2.
The security issue has since been resolved in Git 2.21.0
- The v2 upload-pack protocol implementation failed to honor hidden-ref configuration, which has been corrected. (merge e20b4192a3 jk/proto-v2-hidden-refs-fix later to maint).
Add a feature flag to control support for protocol v2 for Git versions 2.21.0 and above.
A feature flag is necessary in case further security issues are identified in the new protocol.