summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
authorMatthew Bowen <matthew@mgbowen.com>2014-03-05 21:49:23 -0500
committerMatthew Bowen <matthew@mgbowen.com>2014-03-05 21:49:23 -0500
commitb9f819978c571cc806827e8b3ebc1a58a0755999 (patch)
tree64c94ef334360b064a3bdf9b6069c1422f727150 /src/repository.c
parenta064dc2d0b6206116a35be4b62c58c3c1170d5de (diff)
downloadlibgit2-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/repository.c')
-rw-r--r--src/repository.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/repository.c b/src/repository.c
index b94973c74..fccc16faa 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -2010,3 +2010,15 @@ int git_repository_is_shallow(git_repository *repo)
return error;
return st.st_size == 0 ? 0 : 1;
}
+
+int git_repository_init_init_options(git_repository_init_options* opts, 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;
+ }
+}