summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-09-30 09:17:18 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-09-30 09:17:18 +0200
commit72b7c57093909d3f2333ebbc8c91953fce899b17 (patch)
treea541b94af6e56d6c6d925f79d7259d80762cf53c /include
parentc628ebca63316954b012fc9469e97513759d0353 (diff)
parentd7375662e7b4c885ea4865403e4db4c130e79198 (diff)
downloadlibgit2-72b7c57093909d3f2333ebbc8c91953fce899b17.tar.gz
Merge pull request #3411 from spraints/custom-push-headers
Include custom HTTP headers
Diffstat (limited to 'include')
-rw-r--r--include/git2/remote.h13
-rw-r--r--include/git2/sys/transport.h5
2 files changed, 17 insertions, 1 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 444fe5276..c42d96710 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -241,9 +241,10 @@ 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 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);
+GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_strarray *custom_headers);
/**
* Get the remote repository's reference advertisement list
@@ -546,6 +547,11 @@ typedef struct {
* The default is to auto-follow tags.
*/
git_remote_autotag_option_t download_tags;
+
+ /**
+ * Extra headers for this fetch operation
+ */
+ git_strarray custom_headers;
} git_fetch_options;
#define GIT_FETCH_OPTIONS_VERSION 1
@@ -585,6 +591,11 @@ typedef struct {
* Callbacks to use for this push operation
*/
git_remote_callbacks callbacks;
+
+ /**
+ * Extra headers for this push operation
+ */
+ git_strarray custom_headers;
} git_push_options;
#define GIT_PUSH_OPTIONS_VERSION 1
diff --git a/include/git2/sys/transport.h b/include/git2/sys/transport.h
index 4a75b0832..ca8617f3f 100644
--- a/include/git2/sys/transport.h
+++ b/include/git2/sys/transport.h
@@ -40,6 +40,11 @@ struct git_transport {
git_transport_certificate_check_cb certificate_check_cb,
void *payload);
+ /* Set custom headers for HTTP requests */
+ int (*set_custom_headers)(
+ git_transport *transport,
+ const git_strarray *custom_headers);
+
/* Connect the transport to the remote repository, using the given
* direction. */
int (*connect)(