progress: stop using the_repository
Stop using `the_repository` in the "progress" subsystem by passing in a repository when initializing `struct progress`. Furthermore, store a pointer to the repository in that struct so that we can pass it to the trace2 API when logging information. Adjust callers accordingly by using `the_repository`. While there may be some callers that have a repository available in their context, this trivial conversion allows for easier verification and bubbles up the use of `the_repository` by one level. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
913a1e157c
commit
1f7e6478dc
@ -1264,7 +1264,8 @@ static void write_pack_file(void)
|
||||
struct object_entry **write_order;
|
||||
|
||||
if (progress > pack_to_stdout)
|
||||
progress_state = start_progress(_("Writing objects"), nr_result);
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Writing objects"), nr_result);
|
||||
ALLOC_ARRAY(written_list, to_pack.nr_objects);
|
||||
write_order = compute_write_order();
|
||||
|
||||
@ -2400,7 +2401,8 @@ static void get_object_details(void)
|
||||
struct object_entry **sorted_by_offset;
|
||||
|
||||
if (progress)
|
||||
progress_state = start_progress(_("Counting objects"),
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Counting objects"),
|
||||
to_pack.nr_objects);
|
||||
|
||||
CALLOC_ARRAY(sorted_by_offset, to_pack.nr_objects);
|
||||
@ -3220,7 +3222,8 @@ static void prepare_pack(int window, int depth)
|
||||
unsigned nr_done = 0;
|
||||
|
||||
if (progress)
|
||||
progress_state = start_progress(_("Compressing objects"),
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Compressing objects"),
|
||||
nr_deltas);
|
||||
QSORT(delta_list, n, type_size_sort);
|
||||
ll_find_deltas(delta_list, n, window+1, depth, &nr_done);
|
||||
@ -3648,7 +3651,8 @@ static void add_objects_in_unpacked_packs(void);
|
||||
static void enumerate_cruft_objects(void)
|
||||
{
|
||||
if (progress)
|
||||
progress_state = start_progress(_("Enumerating cruft objects"), 0);
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Enumerating cruft objects"), 0);
|
||||
|
||||
add_objects_in_unpacked_packs();
|
||||
add_unreachable_loose_objects();
|
||||
@ -3674,7 +3678,8 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
|
||||
revs.ignore_missing_links = 1;
|
||||
|
||||
if (progress)
|
||||
progress_state = start_progress(_("Enumerating cruft objects"), 0);
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Enumerating cruft objects"), 0);
|
||||
ret = add_unseen_recent_objects_to_traversal(&revs, cruft_expiration,
|
||||
set_cruft_mtime, 1);
|
||||
stop_progress(&progress_state);
|
||||
@ -3693,7 +3698,8 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
|
||||
if (prepare_revision_walk(&revs))
|
||||
die(_("revision walk setup failed"));
|
||||
if (progress)
|
||||
progress_state = start_progress(_("Traversing cruft objects"), 0);
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Traversing cruft objects"), 0);
|
||||
nr_seen = 0;
|
||||
traverse_commit_list(&revs, show_cruft_commit, show_cruft_object, NULL);
|
||||
|
||||
@ -4625,7 +4631,8 @@ int cmd_pack_objects(int argc,
|
||||
prepare_packing_data(the_repository, &to_pack);
|
||||
|
||||
if (progress && !cruft)
|
||||
progress_state = start_progress(_("Enumerating objects"), 0);
|
||||
progress_state = start_progress(the_repository,
|
||||
_("Enumerating objects"), 0);
|
||||
if (stdin_packs) {
|
||||
/* avoids adding objects in excluded packs */
|
||||
ignore_packed_keep_in_core = 1;
|
||||
|
||||
Reference in New Issue
Block a user