summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-03-13 23:01:11 +0100
committerPatrick Steinhardt <ps@pks.im>2020-03-22 16:23:47 +0100
commita2d3316a2bf7683c3e317ce4a596ea9139992db2 (patch)
tree27952c5f911200c75c1213776e3375461fcef5e3
parent9a1024465cf3650d513d3e997435683fcf518e2b (diff)
downloadlibgit2-a2d3316a2bf7683c3e317ce4a596ea9139992db2.tar.gz
refdb_fs: initialize backend version
While the `git_refdb_backend()` struct has a version, we do not initialize it correctly when calling `git_refdb_backend_fs()`. Fix this by adding the call to `git_refdb_init_backend()`.
-rw-r--r--src/refdb_fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index a721f9841..1e53b3af5 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -2129,6 +2129,9 @@ int git_refdb_backend_fs(
backend = git__calloc(1, sizeof(refdb_fs_backend));
GIT_ERROR_CHECK_ALLOC(backend);
+ if (git_refdb_init_backend(&backend->parent, GIT_REFDB_BACKEND_VERSION) < 0)
+ goto fail;
+
backend->repo = repository;
if (repository->gitdir) {