Commit b9bf5d70 by Carlos Martín Nieto

clone: re-add a way to ignore certificate errors

This used to be done via transport flags, which was removed in a
previous commit.
parent 6ac15eff
...@@ -63,6 +63,7 @@ typedef struct git_clone_options { ...@@ -63,6 +63,7 @@ typedef struct git_clone_options {
git_checkout_opts checkout_opts; git_checkout_opts checkout_opts;
int bare; int bare;
int ignore_cert_errors;
git_remote_callbacks *remote_callbacks; git_remote_callbacks *remote_callbacks;
const char* checkout_branch; const char* checkout_branch;
......
...@@ -310,6 +310,9 @@ static int create_and_configure_origin( ...@@ -310,6 +310,9 @@ static int create_and_configure_origin(
if ((error = git_remote_create(&origin, repo, "origin", url)) < 0) if ((error = git_remote_create(&origin, repo, "origin", url)) < 0)
goto on_error; goto on_error;
if (options->ignore_cert_errors)
git_remote_check_cert(origin, 0);
if (options->remote_callbacks && if (options->remote_callbacks &&
(error = git_remote_set_callbacks(origin, options->remote_callbacks)) < 0) (error = git_remote_set_callbacks(origin, options->remote_callbacks)) < 0)
goto on_error; goto on_error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment