summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-30 11:16:31 -0700
committerRussell Belfer <rb@github.com>2014-05-02 09:21:33 -0700
commitbc91347b5894c98964a12c6637d5ca91d9723b42 (patch)
tree3b6ccd7b2d67336cc5aa4d4eaadd334552590e18 /src/odb.c
parent702efc891f2a620f10998062ba0c00b34100f632 (diff)
downloadlibgit2-bc91347b5894c98964a12c6637d5ca91d9723b42.tar.gz
Fix remaining init_options inconsistencies
There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/odb.c b/src/odb.c
index 00740d2e2..20a3f6c6e 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -1123,14 +1123,9 @@ int git_odb__error_ambiguous(const char *message)
return GIT_EAMBIGUOUS;
}
-int git_odb_init_backend(git_odb_backend* backend, int version)
+int git_odb_init_backend(git_odb_backend *backend, unsigned int version)
{
- if (version != GIT_ODB_BACKEND_VERSION) {
- giterr_set(GITERR_INVALID, "Invalid version %d for git_odb_backend", version);
- return -1;
- } else {
- git_odb_backend b = GIT_ODB_BACKEND_INIT;
- memcpy(backend, &b, sizeof(b));
- return 0;
- }
+ GIT_INIT_STRUCTURE_FROM_TEMPLATE(
+ backend, version, git_odb_backend, GIT_ODB_BACKEND_INIT);
+ return 0;
}