git-lfs/t/cmd
brian m. carlson 460701af84
lfstest-gitserver: pass the protocol version to Git
Some time back, Git added support for protocol version 2 over HTTP.
This is announced by the `Git-Protocol` header, the value of which Git
expects to see as the `GIT_PROTOCOL` environment variable.  If it
receives that value, then it switches into protocol v2 mode.

While this is a nice to have in general, it's presently important to fix
our testsuite in CI when testing in SHA-256 mode.  In that mode, we set
`GIT_DEFAULT_HASH=sha256` to specify the default hash algorithm.  In
protocols v0 and v1, Git does not send a capabilities line by default
(although one is accepted) in an empty repository, and if no such line
is present, it's not possible to discern the hash algorithm in use.

Git recently (after 2.40) added a patch that resulted in empty
repositories that are cloned not honouring `GIT_DEFAULT_HASH` in such a
case, so if no refs are set, we end up with a SHA-1 repository, which
makes our tests fail since they don't interoperate.  This will likely be
fixed upstream by both announcing a dummy capabilities line like for
pushes and by restoring the use of `GIT_DEFAULT_HASH` when no hash
algorithm can be explicitly determined.

In any event, none of this matters with protocol v2, since in that case
capabilities are sent as part of the initial refs request and we always
know the hash algorithm.  Since this will always work for affected Git
versions, let's make sure we enable protocol v2 in the test server if
the client supports it.
2023-04-26 19:25:34 +00:00
..
util Set package version to v3 2021-09-02 20:41:08 +00:00
git-credential-lfsnoop.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
git-credential-lfstest.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
lfs-askpass.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
lfs-ssh-echo.go ssh: fix multiplexing condition 2022-10-14 14:33:32 +00:00
lfs-ssh-proxy-test.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
lfstest-badpathcheck.go t: add lfstest-badpathcheck helper for path tests 2022-04-19 09:45:20 -07:00
lfstest-count-tests.go Log test server stderr to log 2019-03-27 17:18:20 +00:00
lfstest-customadapter.go Set package version to v3 2021-09-02 20:41:08 +00:00
lfstest-gitserver.go lfstest-gitserver: pass the protocol version to Git 2023-04-26 19:25:34 +00:00
lfstest-realpath.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
lfstest-standalonecustomadapter.go Set package version to v3 2021-09-02 20:41:08 +00:00
lfstest-testutils.go Set package version to v3 2021-09-02 20:41:08 +00:00