summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-30 11:16:31 -0700
committerRussell Belfer <rb@github.com>2014-05-02 09:21:33 -0700
commitbc91347b5894c98964a12c6637d5ca91d9723b42 (patch)
tree3b6ccd7b2d67336cc5aa4d4eaadd334552590e18 /src/remote.c
parent702efc891f2a620f10998062ba0c00b34100f632 (diff)
downloadlibgit2-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/remote.c')
-rw-r--r--src/remote.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/remote.c b/src/remote.c
index be7198a98..8f302a51e 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1736,14 +1736,9 @@ const git_refspec *git_remote_get_refspec(const git_remote *remote, size_t n)
return git_vector_get(&remote->refspecs, n);
}
-int git_remote_init_callbacks(git_remote_callbacks* opts, int version)
+int git_remote_init_callbacks(git_remote_callbacks *opts, unsigned int version)
{
- if (version != GIT_REMOTE_CALLBACKS_VERSION) {
- giterr_set(GITERR_INVALID, "Invalid version %d for git_remote_callbacks", version);
- return -1;
- } else {
- git_remote_callbacks o = GIT_REMOTE_CALLBACKS_INIT;
- memcpy(opts, &o, sizeof(o));
- return 0;
- }
+ GIT_INIT_STRUCTURE_FROM_TEMPLATE(
+ opts, version, git_remote_callbacks, GIT_REMOTE_CALLBACKS_INIT);
+ return 0;
}