Merge branch 'jh/fsck-promisors'
In preparation for implementing narrow/partial clone, the machinery for checking object connectivity used by gc and fsck has been taught that a missing object is OK when it is referenced by a packfile specially marked as coming from trusted repository that promises to make them available on-demand and lazily. * jh/fsck-promisors: gc: do not repack promisor packfiles rev-list: support termination at promisor objects sha1_file: support lazily fetching missing objects introduce fetch-object: fetch one promisor object index-pack: refactor writing of .keep files fsck: support promisor objects as CLI argument fsck: support referenced promisor objects fsck: support refs pointing to promisor objects fsck: introduce partialclone extension extension.partialclone: introduce partial clone extension
This commit is contained in:
@ -101,12 +101,15 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
struct rev_info revs;
|
||||
struct progress *progress = NULL;
|
||||
int exclude_promisor_objects = 0;
|
||||
const struct option options[] = {
|
||||
OPT__DRY_RUN(&show_only, N_("do not remove, show only")),
|
||||
OPT__VERBOSE(&verbose, N_("report pruned objects")),
|
||||
OPT_BOOL(0, "progress", &show_progress, N_("show progress")),
|
||||
OPT_EXPIRY_DATE(0, "expire", &expire,
|
||||
N_("expire objects older than <time>")),
|
||||
OPT_BOOL(0, "exclude-promisor-objects", &exclude_promisor_objects,
|
||||
N_("limit traversal to objects outside promisor packfiles")),
|
||||
OPT_END()
|
||||
};
|
||||
char *s;
|
||||
@ -139,6 +142,10 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
|
||||
show_progress = isatty(2);
|
||||
if (show_progress)
|
||||
progress = start_delayed_progress(_("Checking connectivity"), 0);
|
||||
if (exclude_promisor_objects) {
|
||||
fetch_if_missing = 0;
|
||||
revs.exclude_promisor_objects = 1;
|
||||
}
|
||||
|
||||
mark_reachable_objects(&revs, 1, expire, progress);
|
||||
stop_progress(&progress);
|
||||
|
Reference in New Issue
Block a user