clone: do faster object check for partial clones

For partial clones, doing a full connectivity check is wasteful; we skip
promisor objects (which, for a partial clone, is all known objects), and
enumerating them all to exclude them from the connectivity check can
take a significant amount of time on large repos.

At most, we want to make sure that we get the objects referred to by any
wanted refs. For partial clones, just check that these objects were
transferred.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Josh Steadmon
2019-04-19 14:00:13 -07:00
committed by Junio C Hamano
parent 041f5ea1cf
commit dfa33a298d
3 changed files with 29 additions and 2 deletions

View File

@ -46,6 +46,14 @@ struct check_connected_options {
* during a fetch.
*/
unsigned is_deepening_fetch : 1;
/*
* If non-zero, only check the top-level objects referenced by the
* wanted refs (passed in as cb_data). This is useful for partial
* clones, where enumerating and excluding all promisor objects is very
* slow and the commit-walk itself becomes a no-op.
*/
unsigned check_refs_only : 1;
};
#define CHECK_CONNECTED_INIT { 0 }