diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2021-02-22 20:20:06 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-22 21:07:40 +0100 |
commit | 726b25a91ba0e8f26f83c8d39ad16351b7bdb510 (patch) | |
tree | e7a717d55dae65d2fcc0f901f58a306bcd36a726 /http-fetch.c | |
parent | The third batch (diff) | |
download | git-726b25a91ba0e8f26f83c8d39ad16351b7bdb510.tar.xz git-726b25a91ba0e8f26f83c8d39ad16351b7bdb510.zip |
http: allow custom index-pack args
Currently, when fetching, packfiles referenced by URIs are run through
index-pack without any arguments other than --stdin and --keep, no
matter what arguments are used for the packfile that is inline in the
fetch response. As a preparation for ensuring that all packs (whether
inline or not) use the same index-pack arguments, teach the http
subsystem to allow custom index-pack arguments.
http-fetch has been updated to use the new API. For now, it passes
--keep alone instead of --keep with a process ID, but this is only
temporary because http-fetch itself will be taught to accept index-pack
parameters (instead of using a hardcoded constant) in a subsequent
commit.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-fetch.c')
-rw-r--r-- | http-fetch.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/http-fetch.c b/http-fetch.c index c4ccc5fea9..2d1d9d054f 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -43,6 +43,9 @@ static int fetch_using_walker(const char *raw_url, int get_verbosely, return rc; } +static const char *index_pack_args[] = + {"index-pack", "--stdin", "--keep", NULL}; + static void fetch_single_packfile(struct object_id *packfile_hash, const char *url) { struct http_pack_request *preq; @@ -55,7 +58,8 @@ static void fetch_single_packfile(struct object_id *packfile_hash, if (preq == NULL) die("couldn't create http pack request"); preq->slot->results = &results; - preq->generate_keep = 1; + preq->index_pack_args = index_pack_args; + preq->preserve_index_pack_stdout = 1; if (start_active_slot(preq->slot)) { run_active_slot(preq->slot); |