diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-04-22 13:42:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-22 13:42:43 -0700 |
commit | 0c601052a5f761fd9c207a56ae11789c8598e25d (patch) | |
tree | 3ede5e384f22b313aa16a5b6e85d3d764c52b6b0 /connected.c | |
parent | 06aaafbd82aaf845d85c0f8eea78c52f1219187c (diff) | |
parent | 2b98478c6fc32b04434981c783b0472e0137cfad (diff) | |
download | git-0c601052a5f761fd9c207a56ae11789c8598e25d.tar.gz |
Merge branch 'jt/connectivity-check-optim-in-partial-clone'
Simplify the commit ancestry connectedness check in a partial clone
repository in which "promised" objects are assumed to be obtainable
lazily on-demand from promisor remote repositories.
* jt/connectivity-check-optim-in-partial-clone:
connected: always use partial clone optimization
Diffstat (limited to 'connected.c')
-rw-r--r-- | connected.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/connected.c b/connected.c index ac52b07b47..3135b71e19 100644 --- a/connected.c +++ b/connected.c @@ -52,7 +52,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data, strbuf_release(&idx_file); } - if (opt->check_refs_are_promisor_objects_only) { + if (has_promisor_remote()) { /* * For partial clones, we don't want to have to do a regular * connectivity check because we have to enumerate and exclude @@ -75,13 +75,18 @@ int check_connected(oid_iterate_fn fn, void *cb_data, if (find_pack_entry_one(oid.hash, p)) goto promisor_pack_found; } - return 1; + /* + * Fallback to rev-list with oid and the rest of the + * object IDs provided by fn. + */ + goto no_promisor_pack_found; promisor_pack_found: ; } while (!fn(cb_data, &oid)); return 0; } +no_promisor_pack_found: if (opt->shallow_file) { argv_array_push(&rev_list.args, "--shallow-file"); argv_array_push(&rev_list.args, opt->shallow_file); |