summaryrefslogtreecommitdiff
path: root/http.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2020-06-10 20:57:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-11 01:06:34 (GMT)
commit8d5d2a34df4f82cd9cce913fa25f3a3c2c07d126 (patch)
tree5bed1dd7872cbc4bf914e4d38008f602d6654032 /http.h
parent8e6adb69e18b18de72f0114d153b47bed4560560 (diff)
downloadgit-8d5d2a34df4f82cd9cce913fa25f3a3c2c07d126.zip
git-8d5d2a34df4f82cd9cce913fa25f3a3c2c07d126.tar.gz
git-8d5d2a34df4f82cd9cce913fa25f3a3c2c07d126.tar.bz2
http-fetch: support fetching packfiles by URL
Teach http-fetch the ability to download packfiles directly, given a URL, and to verify them. The http_pack_request suite has been augmented with a function that takes a URL directly. With this function, the hash is only used to determine the name of the temporary file. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.h')
-rw-r--r--http.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/http.h b/http.h
index bbc6b07..dc49c60 100644
--- a/http.h
+++ b/http.h
@@ -216,6 +216,15 @@ int http_get_info_packs(const char *base_url,
struct http_pack_request {
char *url;
+
+ /*
+ * If this is true, finish_http_pack_request() will pass "--keep" to
+ * index-pack, resulting in the creation of a keep file, and will not
+ * suppress its stdout (that is, the "keep\t<hash>\n" line will be
+ * printed to stdout).
+ */
+ unsigned generate_keep : 1;
+
FILE *packfile;
struct strbuf tmpfile;
struct active_request_slot *slot;
@@ -223,6 +232,8 @@ struct http_pack_request {
struct http_pack_request *new_http_pack_request(
const unsigned char *packed_git_hash, const char *base_url);
+struct http_pack_request *new_direct_http_pack_request(
+ const unsigned char *packed_git_hash, char *url);
int finish_http_pack_request(struct http_pack_request *preq);
void release_http_pack_request(struct http_pack_request *preq);