summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-10-02 14:04:44 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-02 14:04:44 +0200
commit0e0cf78773bea0d06298ba3bf981a3be839041df (patch)
tree4b879238df61eccc2f048fe51e10fce421967e26 /src
parentffc97d51264f8af435ccf52d33a62a6925b174c9 (diff)
downloadlibgit2-0e0cf78773bea0d06298ba3bf981a3be839041df.tar.gz
clone: put the callbacks struct directly in the clone options
There's no need for this to be a pointer to somewhere else.
Diffstat (limited to 'src')
-rw-r--r--src/clone.c3
-rw-r--r--src/remote.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/clone.c b/src/clone.c
index 1af6e393f..f3e365c07 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -315,8 +315,7 @@ static int create_and_configure_origin(
if (options->ignore_cert_errors)
git_remote_check_cert(origin, 0);
- if (options->remote_callbacks &&
- (error = git_remote_set_callbacks(origin, options->remote_callbacks)) < 0)
+ if ((error = git_remote_set_callbacks(origin, &options->remote_callbacks)) < 0)
goto on_error;
if ((error = git_remote_save(origin)) < 0)
diff --git a/src/remote.c b/src/remote.c
index ace886502..ccedf2386 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1153,7 +1153,7 @@ void git_remote_check_cert(git_remote *remote, int check)
remote->check_cert = check;
}
-int git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callbacks)
+int git_remote_set_callbacks(git_remote *remote, const git_remote_callbacks *callbacks)
{
assert(remote && callbacks);
@@ -1162,7 +1162,7 @@ int git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callbacks
memcpy(&remote->callbacks, callbacks, sizeof(git_remote_callbacks));
if (remote->transport && remote->transport->set_callbacks)
- remote->transport->set_callbacks(remote->transport,
+ return remote->transport->set_callbacks(remote->transport,
remote->callbacks.progress,
NULL,
remote->callbacks.payload);