summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/repository.c b/src/repository.c
index 8daa04d5d..ac7af7692 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -2026,14 +2026,11 @@ int git_repository_is_shallow(git_repository *repo)
return st.st_size == 0 ? 0 : 1;
}
-int git_repository_init_init_options(git_repository_init_options* opts, int version)
+int git_repository_init_init_options(
+ git_repository_init_options *opts, unsigned int version)
{
- if (version != GIT_REPOSITORY_INIT_OPTIONS_VERSION) {
- giterr_set(GITERR_INVALID, "Invalid version %d for git_repository_init_options", version);
- return -1;
- } else {
- git_repository_init_options o = GIT_REPOSITORY_INIT_OPTIONS_INIT;
- memcpy(opts, &o, sizeof(o));
- return 0;
- }
+ GIT_INIT_STRUCTURE_FROM_TEMPLATE(
+ opts, version, git_repository_init_options,
+ GIT_REPOSITORY_INIT_OPTIONS_INIT);
+ return 0;
}