diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-10-23 09:16:15 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-04 07:32:25 -0800 |
| commit | adecd5f0b6fdd40219d5503fdaf46aa8d36a4ff7 (patch) | |
| tree | 360f985ccb8aba8b1fe4850910743bd6fc8292ca /refs/files-backend.c | |
| parent | refs: expose peeled object ID via the iterator (diff) | |
| download | git-adecd5f0b6fdd40219d5503fdaf46aa8d36a4ff7.tar.gz git-adecd5f0b6fdd40219d5503fdaf46aa8d36a4ff7.zip | |
upload-pack: convert to use `reference_get_peeled_oid()`
The `write_v0_ref()` callback is invoked from two callsites:
- Once via `send_ref()` which is a callback passed to
`for_each_namespaced_ref_1()` and `refs_head_ref_namespaced()`.
- Once manually to announce capabilities.
When sending references to the client we also send the peeled value of
tags. As we don't have a `struct reference` available in the second
case, we cannot easily peel by calling `reference_get_peeled_oid()`, but
we instead have to depend on on global state via `peel_iterated_oid()`.
We do have a reference available though in the first case, it's only the
second case that keeps us from using `reference_get_peeled_oid()`. But
that second case only announces capabilities anyway, so we're not really
handling a reference at all here.
Adapt that case to construct a reference manually and pass that to
`write_v0_ref()`. Start to use `reference_get_peeled_oid()` now that we
always have a `struct reference` available.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
0 files changed, 0 insertions, 0 deletions
