Fix isValidGitShallowCloneResponse
commitc04147328fa3006c75b6a669d6c0e6ecb335be01
authorepriestley <git@epriestley.com>
Fri, 30 Oct 2020 20:03:34 +0000 (30 13:03 -0700)
committerepriestley <git@epriestley.com>
Fri, 30 Oct 2020 20:46:24 +0000 (30 13:46 -0700)
treeaa31fb0fe65f0ad3f013d4dd78b5b5b4f08844aa
parent671986592bafc4b2f059319d9e320cab46445ac2
Fix isValidGitShallowCloneResponse

Summary:
Changes the heuristic method by which non-zero exit statuses from git-http-backend are found to be due to packfile negotiation during shallow fetches, etc.

Instead of checking git-http-backend stderr for a generic "hung up" error message, see if the pack-result response contains a terminating flush packet ("0000"). This should give a greater assurance that the request was handled correctly and the response is complete.

Test Plan: Run `GIT_CURL_VERBOSE=1 git fetch --depth 1 https://host.example/source/repo.git HEAD` to ensure it completes and includes two successful POST requests during packfile negotiation (the last one actually receives the packfile).

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, dzduvall

Tags: #diffusion

Differential Revision: https://secure.phabricator.com/D21484
src/applications/diffusion/controller/DiffusionServeController.php