summaryrefslogtreecommitdiff
path: root/src/clone.c
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-05-02 09:50:15 -0700
committerVicent Marti <vicent@github.com>2014-05-02 09:50:15 -0700
commit272b462db7cfb50c1ab69e1edda214b21f242ae5 (patch)
tree13c7a7ef6e7ef1e6d90949e60a3d4677ef9096e4 /src/clone.c
parent9862ef8ef8ffd95a74be8082acab9fea0de85edb (diff)
parent99dfa470398b9c4e06e5a5ee61868d3b9e21b26e (diff)
downloadlibgit2-272b462db7cfb50c1ab69e1edda214b21f242ae5.tar.gz
Merge pull request #2308 from libgit2/rb/diff-update-index-stat-cache
Reduce excessive OID calculation for diff and stat
Diffstat (limited to 'src/clone.c')
-rw-r--r--src/clone.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/clone.c b/src/clone.c
index 62f103561..c6be00f0e 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -445,14 +445,9 @@ int git_clone(
return error;
}
-int git_clone_init_options(git_clone_options* opts, int version)
+int git_clone_init_options(git_clone_options *opts, unsigned int version)
{
- if (version != GIT_CLONE_OPTIONS_VERSION) {
- giterr_set(GITERR_INVALID, "Invalid version %d for git_clone_options", version);
- return -1;
- } else {
- git_clone_options o = GIT_CLONE_OPTIONS_INIT;
- memcpy(opts, &o, sizeof(o));
- return 0;
- }
+ GIT_INIT_STRUCTURE_FROM_TEMPLATE(
+ opts, version, git_clone_options, GIT_CLONE_OPTIONS_INIT);
+ return 0;
}