aboutsummaryrefslogtreecommitdiffstats
path: root/repository.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2023-12-29 08:26:34 +0100
committerJunio C Hamano <gitster@pobox.com>2024-01-02 09:24:47 -0800
commit0fcc285c5eaab904ea9a8ade2696fe61355cf587 (patch)
treeb81e93e9a75fba4ee015e115c67fbda83cac7153 /repository.h
parent465a22b338a05a5ffeeffc6bd9174ef5d9a090a0 (diff)
downloadgit-0fcc285c5eaab904ea9a8ade2696fe61355cf587.tar.gz
refs: refactor logic to look up storage backends
In order to look up ref storage backends, we're currently using a linked list of backends, where each backend is expected to set up its `next` pointer to the next ref storage backend. This is kind of a weird setup as backends need to be aware of other backends without much of a reason. Refactor the code so that the array of backends is centrally defined in "refs.c", where each backend is now identified by an integer constant. Expose functions to translate from those integer constants to the name and vice versa, which will be required by subsequent patches. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
-rw-r--r--repository.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/repository.h b/repository.h
index 5f18486f64..ea4c488b81 100644
--- a/repository.h
+++ b/repository.h
@@ -24,6 +24,9 @@ enum fetch_negotiation_setting {
FETCH_NEGOTIATION_NOOP,
};
+#define REF_STORAGE_FORMAT_UNKNOWN 0
+#define REF_STORAGE_FORMAT_FILES 1
+
struct repo_settings {
int initialized;