summaryrefslogtreecommitdiff
path: root/src/transports/local.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-21 22:10:36 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-13 09:46:35 +0200
commit8f0104ecc54db00a075310ab744a19eb60e3d740 (patch)
tree775b3237a853c556a4d44840fc6c562e7b114415 /src/transports/local.c
parent05259114427234831cf4915cbe40a5bb8ea021b0 (diff)
downloadlibgit2-8f0104ecc54db00a075310ab744a19eb60e3d740.tar.gz
Remove the callbacks struct from the remote
Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
Diffstat (limited to 'src/transports/local.c')
-rw-r--r--src/transports/local.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/transports/local.c b/src/transports/local.c
index def8ac037..305c71bf0 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -16,7 +16,6 @@
#include "git2/pack.h"
#include "git2/commit.h"
#include "git2/revparse.h"
-#include "git2/push.h"
#include "pack-objects.h"
#include "refs.h"
#include "posix.h"
@@ -366,7 +365,8 @@ static int local_push_update_remote_ref(
static int local_push(
git_transport *transport,
- git_push *push)
+ git_push *push,
+ const git_remote_callbacks *cbs)
{
transport_local *t = (transport_local *)transport;
git_odb *remote_odb = NULL;
@@ -380,6 +380,8 @@ static int local_push(
unsigned int i;
size_t j;
+ GIT_UNUSED(cbs);
+
/* 'push->remote->url' may be a url or path; convert to a path */
if ((error = git_path_from_url_or_path(&buf, push->remote->url)) < 0) {
git_buf_free(&buf);
@@ -471,7 +473,7 @@ static int local_push(
if (!url || t->parent.close(&t->parent) < 0 ||
t->parent.connect(&t->parent, url,
- push->remote->callbacks.credentials, NULL, GIT_DIRECTION_PUSH, flags))
+ NULL, NULL, GIT_DIRECTION_PUSH, flags))
goto on_error;
}