diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c index b3168f735..ffc3bca29 100644 --- a/src/config.c +++ b/src/config.c @@ -1276,14 +1276,9 @@ cleanup: return error; } -int git_config_init_backend(git_config_backend* backend, int version) +int git_config_init_backend(git_config_backend *backend, unsigned int version) { - if (version != GIT_CONFIG_BACKEND_VERSION) { - giterr_set(GITERR_INVALID, "Invalid version %d for git_config_backend", version); - return -1; - } else { - git_config_backend b = GIT_CONFIG_BACKEND_INIT; - memcpy(backend, &b, sizeof(b)); - return 0; - } + GIT_INIT_STRUCTURE_FROM_TEMPLATE( + backend, version, git_config_backend, GIT_CONFIG_BACKEND_INIT); + return 0; } |