Commit ac9b51278996b864d0a2f7d61a827f89cbd4ff23

Matt Burke 2015-09-04T09:20:45

Pull extra_http_headers from the git_remote

diff --git a/src/remote.c b/src/remote.c
index 7404bf4..b6fb87e 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1643,6 +1643,8 @@ void git_remote_free(git_remote *remote)
 	free_refspecs(&remote->passive_refspecs);
 	git_vector_free(&remote->passive_refspecs);
 
+	git__free(remote->extra_http_headers);
+
 	git_push_free(remote->push);
 	git__free(remote->url);
 	git__free(remote->pushurl);
diff --git a/src/remote.h b/src/remote.h
index e696997..bfb2036 100644
--- a/src/remote.h
+++ b/src/remote.h
@@ -32,6 +32,7 @@ struct git_remote {
 	git_remote_autotag_option_t download_tags;
 	int prune_refs;
 	int passed_refspecs;
+	git_strarray *extra_http_headers;
 };
 
 const char* git_remote__urlfordirection(struct git_remote *remote, int direction);
diff --git a/src/transports/http.c b/src/transports/http.c
index d348310..664cd80 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -974,6 +974,7 @@ static int http_action(
 	if ((!t->connection_data.host || !t->connection_data.port || !t->connection_data.path) &&
 		 (ret = gitno_connection_data_from_url(&t->connection_data, url, NULL)) < 0)
 		return ret;
+	t->connection_data.extra_headers = t->owner->owner->extra_http_headers;
 
 	if ((ret = http_connect(t)) < 0)
 		return ret;