Skip to content

Commit

Permalink
clone: unbundle the advertised bundles
Browse files Browse the repository at this point in the history
A previous change introduced the transport methods to acquire a bundle
list from the 'bundle-uri' protocol v2 verb, when advertised _and_ when
the client has chosen to enable the feature.

Teach Git to download and unbundle the data advertised by those bundles
during 'git clone'.

Also, since the --bundle-uri option exists, we do not want to mix the
advertised bundles with the user-specified bundles.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
  • Loading branch information
derrickstolee committed May 20, 2022
1 parent 95ca7c5 commit 9b58ac6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,11 +1264,20 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (refs)
mapped_refs = wanted_peer_refs(refs, &remote->fetch);

/*
* Populate transport->got_remote_bundle_uri and
* transport->bundle_uri. We might get nothing.
*/
transport_get_remote_bundle_uri(transport, 1);
if (!bundle_uri) {
/*
* Populate transport->got_remote_bundle_uri and
* transport->bundle_uri. We might get nothing.
*/
transport_get_remote_bundle_uri(transport, 1);

if (transport->bundles) {
if (fetch_bundle_list(the_repository,
remote->url[0],
transport->bundles))
warning(_("failed to fetch advertised bundles"));
}
}

if (mapped_refs) {
int hash_algo = hash_algo_by_ptr(transport_get_hash_algo(transport));
Expand Down

0 comments on commit 9b58ac6

Please sign in to comment.