]> git.ipfire.org Git - thirdparty/git.git/commit
refs: receive and use the reference storage payload
authorKarthik Nayak <karthik.188@gmail.com>
Wed, 25 Feb 2026 09:40:44 +0000 (10:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Feb 2026 17:27:12 +0000 (09:27 -0800)
commitd74aacd7c41573e586c1a9d7204aaaebf9901bd1
tree8b9fc6ee5e4f1875f40b7ccc42c3724b3302dce9
parent2a32ac429e9faaecaf1c15c18e7873da5754a8d7
refs: receive and use the reference storage payload

An upcoming commit will add support for providing an URI via the
'extensions.refStorage' config. The URI will contain the reference
backend and a corresponding payload. The payload can be then used for
providing an alternate locations for the reference backend.

To prepare for this, modify the existing backends to accept such an
argument when initializing via the 'init()' function. Both the files
and reftable backends will parse the information to be filesystem paths
to store references. Given that no callers pass any payload yet this is
essentially a no-op change for now.

To enable this, provide a 'refs_compute_filesystem_location()' function
which will parse the current 'gitdir' and the 'payload' to provide the
final reference directory and common reference directory (if working in
a linked worktree).

The documentation and tests will be added alongside the extension of the
config variable.

Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs/files-backend.c
refs/packed-backend.c
refs/packed-backend.h
refs/refs-internal.h
refs/reftable-backend.c