summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorAxel Rasmussen <axelrasmussen@google.com>2015-10-01 18:01:32 -0700
committerAxel Rasmussen <axelrasmussen@google.com>2015-10-01 18:01:32 -0700
commitc7b17fb5cd1adac57c4300e95cef8c7064b0601a (patch)
treeb1a1bcd6e1d88f1cd48b7fdb414d6444c28eb896 /include/git2
parent28cdb3153c8c6d651c5b2afcf315a2d188e9fde9 (diff)
parenta99f33e9b05504ea5eccd9c9210cd4a9e8d11695 (diff)
downloadlibgit2-c7b17fb5cd1adac57c4300e95cef8c7064b0601a.tar.gz
Merge branch 'master' into nsec_fix_next
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/remote.h13
-rw-r--r--include/git2/sys/odb_backend.h4
-rw-r--r--include/git2/sys/refdb_backend.h4
-rw-r--r--include/git2/sys/transport.h5
4 files changed, 23 insertions, 3 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/odb_backend.h b/include/git2/sys/odb_backend.h
index fe102ff3c..e423a9236 100644
--- a/include/git2/sys/odb_backend.h
+++ b/include/git2/sys/odb_backend.h
@@ -83,6 +83,10 @@ struct git_odb_backend {
git_odb_writepack **, git_odb_backend *, git_odb *odb,
git_transfer_progress_cb progress_cb, void *progress_payload);
+ /**
+ * Frees any resources held by the odb (including the `git_odb_backend`
+ * itself). An odb backend implementation must provide this function.
+ */
void (* free)(git_odb_backend *);
};
diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h
index 01fce8009..5129ad84a 100644
--- a/include/git2/sys/refdb_backend.h
+++ b/include/git2/sys/refdb_backend.h
@@ -130,8 +130,8 @@ struct git_refdb_backend {
int (*ensure_log)(git_refdb_backend *backend, const char *refname);
/**
- * Frees any resources held by the refdb. A refdb implementation may
- * provide this function; if it is not provided, nothing will be done.
+ * Frees any resources held by the refdb (including the `git_refdb_backend`
+ * itself). A refdb backend implementation must provide this function.
*/
void (*free)(git_refdb_backend *backend);
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)(