Commit 4dbb468
committed
fixup! gvfs-helper: create tool to fetch objects using the GVFS Protocol
The previous fixup for 84f0e60 (packfile: move packfile store
into object source, 2026-01-09) was incorrect.
That upstream commit moved the packfile store from being a single
global store in `struct object_database` to being per-source in
`struct odb_source`. The previous fixup adapted the
`packfile_store_reprepare()` call by changing:
the_repository->objects->packfiles
to:
the_repository->objects->sources->packfiles
However, this only reprepares the packfile store of the *first*
source in the linked list. This is incorrect because GVFS-helper
writes downloaded objects to `gh_client__chosen_odb`, which is
typically the shared cache alternate (configured via
`gvfs.sharedCache`), not the primary .git/objects directory.
When objects are downloaded into the shared cache but only the
primary source's packfile store is reprepared, the newly created
packfiles remain invisible to subsequent object lookups. This causes
the object lookup code in odb.c to fall through to the expensive
`gh_client__get_immediate()` path, re-fetching objects that were
already successfully downloaded via the batched queue mechanism.
The test t5793.3 "integration: fully implicit: diff 2 commits"
caught this regression. It verifies that blob objects are fetched
via the efficient batched queue path (`gh_client__queue_oid`) and
NOT via the single-object immediate path (`gh_client__get_immediate`).
With the broken fixup, objects were being fetched twice: once via
the queue (correct), and then again via immediate fetch (incorrect)
because the packfile store for the shared cache was never reprepared.
Fix this by repreparing the packfile store of the actual chosen ODB
where objects are written:
gh_client__chosen_odb->packfiles
This variable is guaranteed to be set before
`gh_client__objects__receive_response()` is called, since all
callers go through `gh_client__find_long_running_process()` which
calls `gh_client__choose_odb()` first.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 1a4158b commit 4dbb468
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
0 commit comments