diff options
Diffstat (limited to 'src/clone.c')
| -rw-r--r-- | src/clone.c | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/src/clone.c b/src/clone.c index aa6c43f86..865521bce 100644 --- a/src/clone.c +++ b/src/clone.c @@ -355,42 +355,25 @@ static int clone_internal( return retcode; } -int git_clone_bare( - git_repository **out, - git_remote *origin_remote, - const char *dest_path, - git_transfer_progress_callback fetch_progress_cb, - void *fetch_progress_payload) +int git_clone( + git_repository **out, + git_remote *origin, + const char *local_path, + const git_clone_options *options) { - assert(out && origin_remote && dest_path); - - return clone_internal( - out, - origin_remote, - dest_path, - fetch_progress_cb, - fetch_progress_payload, - NULL, - 1); -} + git_clone_options dummy_options = GIT_CLONE_OPTIONS_INIT; + assert(out && origin && local_path); + if (!options) options = &dummy_options; -int git_clone( - git_repository **out, - git_remote *origin_remote, - const char *workdir_path, - git_checkout_opts *checkout_opts, - git_transfer_progress_callback fetch_progress_cb, - void *fetch_progress_payload) -{ - assert(out && origin_remote && workdir_path); + GITERR_CHECK_VERSION(options, GIT_CLONE_OPTIONS_VERSION, "git_clone_options"); return clone_internal( out, - origin_remote, - workdir_path, - fetch_progress_cb, - fetch_progress_payload, - checkout_opts, - 0); + origin, + local_path, + options->fetch_progress_cb, + options->fetch_progress_payload, + options->checkout_opts, + options->bare ? 1 : 0); } |
