diff options
author | Matthew Bowen <matthew@mgbowen.com> | 2014-03-05 21:49:23 -0500 |
---|---|---|
committer | Matthew Bowen <matthew@mgbowen.com> | 2014-03-05 21:49:23 -0500 |
commit | b9f819978c571cc806827e8b3ebc1a58a0755999 (patch) | |
tree | 64c94ef334360b064a3bdf9b6069c1422f727150 /src/refdb.c | |
parent | a064dc2d0b6206116a35be4b62c58c3c1170d5de (diff) | |
download | libgit2-b9f819978c571cc806827e8b3ebc1a58a0755999.tar.gz |
Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
Diffstat (limited to 'src/refdb.c')
-rw-r--r-- | src/refdb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/refdb.c b/src/refdb.c index 984c3c7f6..3e7a592f8 100644 --- a/src/refdb.c +++ b/src/refdb.c @@ -235,3 +235,15 @@ int git_refdb_ensure_log(git_refdb *db, const char *refname) return db->backend->ensure_log(db->backend, refname); } + +int git_refdb_init_backend(git_refdb_backend* backend, int version) +{ + if (version != GIT_REFDB_BACKEND_VERSION) { + giterr_set(GITERR_INVALID, "Invalid version %d for git_refdb_backend", version); + return -1; + } else { + git_refdb_backend b = GIT_REFDB_BACKEND_INIT; + memcpy(backend, &b, sizeof(b)); + return 0; + } +} |