when I perform git_clone() , it runs successfully, but it clones just .git folder. When I use
git clone http:/url.adress.com/myRemoteRepo C:/destination/to/clone
in terminal, it clones also another folders, not just .git folder and I want git_clone() to work that way, is that possible?
My code:
int num=0;
git_libgit2_init();
git_repository *cloned_repo = NULL;
int error = git_clone(&cloned_repo, all_urls.at(num).c_str(), clone_to.at(num).c_str(), &clone_opts);
if (error != 0) {
const git_error *err = giterr_last();
cerr << "error in clone num " << num << " -> message :" << err->message << endl;
}
else cout << endl << "Clone " << num << " succesful" << "(from url : " << all_urls.at(num) << " " << "to path : " << clone_to.at(num) << ")" << endl;
git_repository_free(cloned_repo);
git_libgit2_shutdown();
There is how I set options
git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT;
// git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
// clone_opts.checkout_opts = checkout_opts;
clone_opts.fetch_opts.callbacks.credentials = cred_acquire_cb;
After commenting these 2 lines, it is working
cloneoperations usually are followed by an automaticcheckout. That's why there is acheckout_optionsdefined insideclone_opts, but you do not specify how you initialize those... - rodrigo