Repository navigation
Closed
Description
When clone() falls back to dumb HTTP and the server lists packs in objects/info/packs, Pitmaster downloads those packs and returns without fetching any loose objects (
Lines 486 to 504 in 5beb97d
| private static function importDumbHttpObjects( | |
| Repository $repo, | |
| DumbHttpClient $client, | |
| string $url, | |
| array $refs, | |
| ): void { | |
| $packs = $client->fetchPackList($url); | |
| if ($packs !== []) { | |
| foreach ($packs as $packName) { | |
| self::writePackFile($repo->gitDir(), $client->fetchPack($url, $packName), $packName); | |
| $idxName = preg_replace('/\.pack$/', '.idx', $packName) ?? $packName . '.idx'; | |
| self::writePackFile($repo->gitDir(), $client->fetchPack($url, $idxName), $idxName); | |
| } | |
| $repo->objectDatabase()->refresh(); | |
| return; | |
| } |
Repro
A bare repository served over plain HTTP that has a pack plus newer loose commits, with git update-server-info run: Pitmaster::clone() against it (after smart HTTP fails) returns a repository whose HEAD points to a missing object; head() throws "HEAD points to a non-commit object".
Expected
After importing the listed packs, walk from the ref tips and fetch any object that is still missing as a loose object, as git's dumb HTTP walker does.
Metadata
Metadata
Assignees
Labels
No labels
Activity