Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bowen <matthew@mgbowen.com>2014-03-06 06:49:23 +0400
committerMatthew Bowen <matthew@mgbowen.com>2014-03-06 06:49:23 +0400
commitb9f819978c571cc806827e8b3ebc1a58a0755999 (patch)
tree64c94ef334360b064a3bdf9b6069c1422f727150 /src/push.c
parenta064dc2d0b6206116a35be4b62c58c3c1170d5de (diff)
Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
Diffstat (limited to 'src/push.c')
-rw-r--r--src/push.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/push.c b/src/push.c
index c2947808e..521355621 100644
--- a/src/push.c
+++ b/src/push.c
@@ -705,3 +705,15 @@ void git_push_free(git_push *push)
git__free(push);
}
+
+int git_push_init_options(git_push_options* opts, int version)
+{
+ if (version != GIT_PUSH_OPTIONS_VERSION) {
+ giterr_set(GITERR_INVALID, "Invalid version %d for git_push_options", version);
+ return -1;
+ } else {
+ git_push_options o = GIT_PUSH_OPTIONS_INIT;
+ memcpy(opts, &o, sizeof(o));
+ return 0;
+ }
+}