refdb: wire up "reftable" storage format

Wire up the "reftable" storage format via the newly implemented reftable
backend.
This commit is contained in:
Patrick Steinhardt
2025-07-12 00:00:21 +02:00
parent 6701e02f1c
commit ee0972cac8
3 changed files with 10 additions and 1 deletions

View File

@@ -23,7 +23,8 @@ GIT_BEGIN_DECL
/** The type of the refdb as determined by "extensions.refStorage". */
typedef enum {
GIT_REFDB_FILES = 1 /**< Files backend using loose and packed refs. */
GIT_REFDB_FILES = 1, /**< Files backend using loose and packed refs. */
GIT_REFDB_REFTABLE = 2 /**< Reftable backend. */
} git_refdb_t;
/**

View File

@@ -56,6 +56,10 @@ int git_refdb_open(git_refdb **out, git_repository *repo)
if ((error = git_refdb_backend_fs(&backend, repo)) < 0)
goto out;
break;
case GIT_REFDB_REFTABLE:
if ((error = git_refdb_backend_reftable(&backend, repo)) < 0)
goto out;
break;
default:
git_error_set(GIT_ERROR_REFERENCE, "unknown reference storage format");
error = GIT_EINVALID;

View File

@@ -137,6 +137,8 @@ GIT_INLINE(const char *) git_refdb_type_name(git_refdb_t type)
switch (type) {
case GIT_REFDB_FILES:
return "files";
case GIT_REFDB_REFTABLE:
return "reftable";
default:
return "unknown";
}
@@ -146,6 +148,8 @@ GIT_INLINE(git_refdb_t) git_refdb_type_fromstr(const char *name)
{
if (strcmp(name, "files") == 0)
return GIT_REFDB_FILES;
if (strcmp(name, "reftable") == 0)
return GIT_REFDB_REFTABLE;
return 0;
}