summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-07 12:57:56 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2016-04-19 13:54:19 +0200
commit07bd3e57d9a9930727695be690c8757f79117d45 (patch)
tree487cd3795e1f0ae208d53889c9a90bbed9924d03 /include
parenta7bece2014ec043cfe58418dc13e982f79dcfcba (diff)
downloadlibgit2-07bd3e57d9a9930727695be690c8757f79117d45.tar.gz
proxy: ask the user for credentials if necessary
Diffstat (limited to 'include')
-rw-r--r--include/git2/remote.h19
-rw-r--r--include/git2/sys/transport.h4
2 files changed, 19 insertions, 4 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 4f345d30c..c459f42cc 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -15,6 +15,7 @@
#include "strarray.h"
#include "transport.h"
#include "pack.h"
+#include "proxy.h"
/**
* @file git2/remote.h
@@ -241,10 +242,11 @@ GIT_EXTERN(const git_refspec *)git_remote_get_refspec(const git_remote *remote,
* @param direction GIT_DIRECTION_FETCH if you want to fetch or
* GIT_DIRECTION_PUSH if you want to push
* @param callbacks the callbacks to use for this connection
+ * @param proxy_opts proxy settings
* @param custom_headers extra HTTP headers to use in this connection
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_strarray *custom_headers);
+GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_proxy_options *proxy_opts, const git_strarray *custom_headers);
/**
* Get the remote repository's reference advertisement list
@@ -549,13 +551,19 @@ typedef struct {
git_remote_autotag_option_t download_tags;
/**
+ * Proxy options to use, by default no proxy is used.
+ */
+ git_proxy_options proxy_opts;
+
+ /**
* Extra headers for this fetch operation
*/
git_strarray custom_headers;
} git_fetch_options;
#define GIT_FETCH_OPTIONS_VERSION 1
-#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_UNSPECIFIED, 1 }
+#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_UNSPECIFIED, 1, \
+ GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED, GIT_PROXY_OPTIONS_INIT }
/**
* Initializes a `git_fetch_options` with default values. Equivalent to
@@ -593,13 +601,18 @@ typedef struct {
git_remote_callbacks callbacks;
/**
+ * Proxy options to use, by default no proxy is used.
+ */
+ git_proxy_options proxy_opts;
+
+ /**
* Extra headers for this push operation
*/
git_strarray custom_headers;
} git_push_options;
#define GIT_PUSH_OPTIONS_VERSION 1
-#define GIT_PUSH_OPTIONS_INIT { GIT_PUSH_OPTIONS_VERSION, 0, GIT_REMOTE_CALLBACKS_INIT }
+#define GIT_PUSH_OPTIONS_INIT { GIT_PUSH_OPTIONS_VERSION, 0, GIT_REMOTE_CALLBACKS_INIT, GIT_PROXY_OPTIONS_INIT }
/**
* Initializes a `git_push_options` with default values. Equivalent to
diff --git a/include/git2/sys/transport.h b/include/git2/sys/transport.h
index ce0234a18..60e38b21a 100644
--- a/include/git2/sys/transport.h
+++ b/include/git2/sys/transport.h
@@ -11,6 +11,7 @@
#include "git2/net.h"
#include "git2/types.h"
#include "git2/strarray.h"
+#include "git2/proxy.h"
/**
* @file git2/sys/transport.h
@@ -53,6 +54,7 @@ struct git_transport {
const char *url,
git_cred_acquire_cb cred_acquire_cb,
void *cred_acquire_payload,
+ const git_proxy_options *proxy_opts,
int direction,
int flags);
@@ -65,7 +67,7 @@ struct git_transport {
git_transport *transport);
/* Executes the push whose context is in the git_push object. */
- int (*push)(git_transport *transport, git_push *push, const git_remote_callbacks *callbacks);
+ int(*push)(git_transport *transport, git_push *push, const git_remote_callbacks *callbacks);
/* This function may be called after a successful call to connect(), when
* the direction is FETCH. The function performs a negotiation to calculate