delta-islands: respect progress flag

The delta island code always prints "Marked %d islands", even if progress has been suppressed with --no-progress or by sending stderr to a non-tty. Let's pass a progress boolean to load_delta_islands(). We already do the same thing for the progress meter in resolve_tree_islands(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 20, 2019 at 04:58 UTC bdbdf42f8ab79374704b769157e7b080d525b73a
3 files changed +5 -4
builtin/pack-objects.c
+1 -1
@@ -3131,7 +3131,7 @@ static void get_object_list(int ac, const char **av)
3131 return;
3132
3133 if (use_delta_islands)
3134 - load_delta_islands(the_repository);
3134 + load_delta_islands(the_repository, progress);
3135
3136 if (prepare_revision_walk(&revs))
3137 die(_("revision walk setup failed"));
delta-islands.c
+3 -2
@@ -454,7 +454,7 @@ static void deduplicate_islands(struct repository *r)
454 free(list);
455 }
456
457 -void load_delta_islands(struct repository *r)
457 +void load_delta_islands(struct repository *r, int progress)
458 {
459 island_marks = kh_init_sha1();
460 remote_islands = kh_init_str();
@@ -463,7 +463,8 @@ void load_delta_islands(struct repository *r)
463 for_each_ref(find_island_for_ref, NULL);
464 deduplicate_islands(r);
465
466 - fprintf(stderr, _("Marked %d islands, done.\n"), island_counter);
466 + if (progress)
467 + fprintf(stderr, _("Marked %d islands, done.\n"), island_counter);
468 }
469
470 void propagate_island_marks(struct commit *commit)
delta-islands.h
+1 -1
@@ -11,7 +11,7 @@ int in_same_island(const struct object_id *, const struct object_id *);
11 void resolve_tree_islands(struct repository *r,
12 int progress,
13 struct packing_data *to_pack);
14 -void load_delta_islands(struct repository *r);
14 +void load_delta_islands(struct repository *r, int progress);
15 void propagate_island_marks(struct commit *commit);
16 int compute_pack_layers(struct packing_data *to_pack);
17