]> git.ipfire.org Git - thirdparty/git.git/commit
refs: support obtaining ref_store for given dir
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 1 Dec 2025 11:24:58 +0000 (12:24 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Dec 2025 00:23:51 +0000 (16:23 -0800)
commitcc4dcc855b374d98b664242ee606752dbdcb176b
tree7cb3d72833ee580faf4ef4ca551fd5a00ff664ee
parent9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
refs: support obtaining ref_store for given dir

The refs subsystem uses the `get_main_ref_store()` to obtain the main
ref_store for a given repository. In the upcoming patches we also want
to create a ref_store for any given reference directory, which may exist
in arbitrary paths. For the files backend and the reftable backend, the
reference directory is generally the $GIT_DIR.

To support such behavior, extract out the core logic for creating out
the ref_store from `get_main_ref_store()` into a new function
`get_ref_store_for_dir()` which can provide the ref_store for a
given (repository, directory, reference format) combination.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c