From c1d024b84378d099f6ff9bb74e442d17587f3081 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Mon, 16 May 2022 20:11:02 +0000 Subject: http: make http_get_file() external This method will be used in an upcoming extension of git-remote-curl to download a single file over HTTP(S) by request. Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- http.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'http.h') diff --git a/http.h b/http.h index df1590e53a..ba303cfb37 100644 --- a/http.h +++ b/http.h @@ -163,6 +163,15 @@ struct http_get_options { */ int http_get_strbuf(const char *url, struct strbuf *result, struct http_get_options *options); +/* + * Downloads a URL and stores the result in the given file. + * + * If a previous interrupted download is detected (i.e. a previous temporary + * file is still around) the download is resumed. + */ +int http_get_file(const char *url, const char *filename, + struct http_get_options *options); + int http_fetch_ref(const char *base, struct ref *ref); /* Helpers for fetching packs */ -- cgit v1.2.3