Git fetches with `--depth` over HTTP results in 500 errors

A 500 error is consistently returned when attempting to fetch with a specified depth from a Diffusion hosted git repo over HTTP. This is due to a failed regular expression match in DiffusionServeController->isValidGitShallowCloneResponse against the stderr of git-http-backend—it needs to be case insensitive.

A better way to heuristically detect whether the packfile negotiation response was successful and complete would be to check for a terminating flush packet (“0000”). I will submit a patch.


Reproduction Instructions
Complete steps which allow someone else who does not have access to your environment to reproduce the bug.

$ cd "$(mktemp -d)"
$ git init .
$ git fetch --depth 1 https://secure.phabricator.com/source/phabricator.git HEAD
error: RPC failed; result=22, HTTP code = 500
fatal: The remote end hung up unexpectedly

Phabricator/Arcanist Version
Output from Config > Version Information or arc version.
current master

I’ve submitted a patch at https://secure.phabricator.com/D21484

I upstreamed this as https://secure.phabricator.com/T13584.

1 Like