bundle: add flags to verify_bundle()

The verify_bundle() method has a 'verbose' option, but we will want to
extend this method to have more granular control over its output. First,
replace this 'verbose' option with a new 'flags' option with a single
possible value: VERIFY_BUNDLE_VERBOSE.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Derrick Stolee
2022-10-12 12:52:37 +00:00
committed by Junio C Hamano
parent c23f592117
commit 89bd7fedf9
5 changed files with 27 additions and 10 deletions

View File

@ -119,7 +119,8 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
goto cleanup;
}
close(bundle_fd);
if (verify_bundle(the_repository, &header, !quiet)) {
if (verify_bundle(the_repository, &header,
quiet ? 0 : VERIFY_BUNDLE_VERBOSE)) {
ret = 1;
goto cleanup;
}
@ -185,7 +186,7 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix)
strvec_pushl(&extra_index_pack_args, "-v", "--progress-title",
_("Unbundling objects"), NULL);
ret = !!unbundle(the_repository, &header, bundle_fd,
&extra_index_pack_args) ||
&extra_index_pack_args, 0) ||
list_bundle_refs(&header, argc, argv);
bundle_header_release(&header);
cleanup: