summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-01-05 14:01:30 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-01-05 14:01:30 -0800
commit88a516aca03e55f174fc1884250be1d0d3fb9fa8 (patch)
tree8ad963a4f270b9184d6774bcabf8c3a74f783bb3 /builtin
parentMerge branch 'jc/merge-detached-head-name' (diff)
parentrepack: make '--quiet' disable progress (diff)
downloadtgif-88a516aca03e55f174fc1884250be1d0d3fb9fa8.tar.xz
Merge branch 'ds/repack-fixlets'
Two fixes around "git repack". * ds/repack-fixlets: repack: make '--quiet' disable progress repack: respect kept objects with '--write-midx -b'
Diffstat (limited to 'builtin')
-rw-r--r--builtin/repack.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index 9b0be6a6ab..c393a5db77 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -612,7 +612,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
struct tempfile *refs_snapshot = NULL;
int i, ext, ret;
FILE *out;
- int show_progress = isatty(2);
+ int show_progress;
/* variables to be filled by option parsing */
int pack_everything = 0;
@@ -693,7 +693,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
write_bitmaps = 0;
}
if (pack_kept_objects < 0)
- pack_kept_objects = write_bitmaps > 0;
+ pack_kept_objects = write_bitmaps > 0 && !write_midx;
if (write_bitmaps && !(pack_everything & ALL_INTO_ONE) && !write_midx)
die(_(incremental_bitmap_conflict_error));
@@ -725,6 +725,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
prepare_pack_objects(&cmd, &po_args);
+ show_progress = !po_args.quiet && isatty(2);
+
strvec_push(&cmd.args, "--keep-true-parents");
if (!pack_kept_objects)
strvec_push(&cmd.args, "--honor-pack-keep");
@@ -926,7 +928,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
}
strbuf_release(&buf);
}
- if (!po_args.quiet && show_progress)
+ if (show_progress)
opts |= PRUNE_PACKED_VERBOSE;
prune_packed_objects(opts);