Skip to content

Commit bdbdf42

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeb582a commit bdbdf42

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3131,7 +3131,7 @@ static void get_object_list(int ac, const char **av)
31313131
return;
31323132

31333133
if (use_delta_islands)
3134-
load_delta_islands(the_repository);
3134+
load_delta_islands(the_repository, progress);
31353135

31363136
if (prepare_revision_walk(&revs))
31373137
die(_("revision walk setup failed"));

delta-islands.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static void deduplicate_islands(struct repository *r)
454454
free(list);
455455
}
456456

457-
void load_delta_islands(struct repository *r)
457+
void load_delta_islands(struct repository *r, int progress)
458458
{
459459
island_marks = kh_init_sha1();
460460
remote_islands = kh_init_str();
@@ -463,7 +463,8 @@ void load_delta_islands(struct repository *r)
463463
for_each_ref(find_island_for_ref, NULL);
464464
deduplicate_islands(r);
465465

466-
fprintf(stderr, _("Marked %d islands, done.\n"), island_counter);
466+
if (progress)
467+
fprintf(stderr, _("Marked %d islands, done.\n"), island_counter);
467468
}
468469

469470
void propagate_island_marks(struct commit *commit)

delta-islands.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int in_same_island(const struct object_id *, const struct object_id *);
1111
void resolve_tree_islands(struct repository *r,
1212
int progress,
1313
struct packing_data *to_pack);
14-
void load_delta_islands(struct repository *r);
14+
void load_delta_islands(struct repository *r, int progress);
1515
void propagate_island_marks(struct commit *commit);
1616
int compute_pack_layers(struct packing_data *to_pack);
1717

0 commit comments

Comments
 (0)