Files
gerrit/java/com/google
David Pursehouse 437d7ef616 Allow to enable git protocol version 2 for upload pack
When receive.enableProtocolV2 is set to true, set the necessary extra
parameters on the UploadPack to tell JGit to handle the request with
protocol v2.

Note that according to JGit's implementation, the git config on the
repository on the server must also be configured to use protocol v2.

This can be achieved either by setting it globally in the gerrit
user's ~/.gitconfig or per repository in the repository's .git/config:

  [protocol]
    version = 2

Test plan:
  - Set protocol.version to 2 in the project's server-side config (or
    in the gerrit user's ~/.gitconfig)

  - Clone the project over SSH or HTTP

  - From the client, run:
    GIT_TRACE_PACKET=1 git -c protocol.version=2 ls-remote

    (one can also configure this permanently on the local project by
     running `git config protocol.version 2`)

  - Observe the packet output including:
    git< version 2

Feature: Issue 9046
Helped-by: David Ostrovsky <david@ostrovsky.org>
Helped-by: Jonathan Nieder <jrn@google.com>
Change-Id: I30290e8f060c1ee11b170aac2baeed10f213aad1
2018-11-14 15:52:04 -08:00
..