diff options
author | Russell Belfer <rb@github.com> | 2014-04-30 11:16:31 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-02 09:21:33 -0700 |
commit | bc91347b5894c98964a12c6637d5ca91d9723b42 (patch) | |
tree | 3b6ccd7b2d67336cc5aa4d4eaadd334552590e18 /src/cherrypick.c | |
parent | 702efc891f2a620f10998062ba0c00b34100f632 (diff) | |
download | libgit2-bc91347b5894c98964a12c6637d5ca91d9723b42.tar.gz |
Fix remaining init_options inconsistencies
There were a couple of "init_opts()" functions a few more cases
of structure initialization that I somehow missed.
Diffstat (limited to 'src/cherrypick.c')
-rw-r--r-- | src/cherrypick.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/cherrypick.c b/src/cherrypick.c index 6a5ca834c..e02348a03 100644 --- a/src/cherrypick.c +++ b/src/cherrypick.c @@ -217,14 +217,10 @@ done: return error; } -int git_cherry_pick_init_opts(git_cherry_pick_options* opts, int version) +int git_cherry_pick_init_options( + git_cherry_pick_options *opts, unsigned int version) { - if (version != GIT_CHERRY_PICK_OPTIONS_VERSION) { - giterr_set(GITERR_INVALID, "Invalid version %d for git_cherry_pick_options", version); - return -1; - } else { - git_cherry_pick_options o = GIT_CHERRY_PICK_OPTIONS_INIT; - memcpy(opts, &o, sizeof(o)); - return 0; - } + GIT_INIT_STRUCTURE_FROM_TEMPLATE( + opts, version, git_cherry_pick_options, GIT_CHERRY_PICK_OPTIONS_INIT); + return 0; } |