mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
refdb: wire up "reftable" storage format
Wire up the "reftable" storage format via the newly implemented reftable backend.
This commit is contained in:
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user