From 8655a8985bcf2891390d464401b198d629edbfc3 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Wed, 30 Apr 2014 11:16:31 -0700 Subject: Fix remaining init_options inconsistencies There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed. --- src/checkout.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/checkout.c') diff --git a/src/checkout.c b/src/checkout.c index 727911694..b869efe2b 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -2240,14 +2240,9 @@ int git_checkout_head( return git_checkout_tree(repo, NULL, opts); } -int git_checkout_init_opts(git_checkout_options* opts, int version) +int git_checkout_init_options(git_checkout_options *opts, unsigned int version) { - if (version != GIT_CHECKOUT_OPTIONS_VERSION) { - giterr_set(GITERR_INVALID, "Invalid version %d for git_checkout_options", version); - return -1; - } else { - git_checkout_options o = GIT_CHECKOUT_OPTIONS_INIT; - memcpy(opts, &o, sizeof(o)); - return 0; - } + GIT_INIT_STRUCTURE_FROM_TEMPLATE( + opts, version, git_checkout_options, GIT_CHECKOUT_OPTIONS_INIT); + return 0; } -- cgit v1.2.1