Git fork

bundle: support fsck message configuration

If the `VERIFY_BUNDLE_FLAG` is set during `unbundle()`, the
git-index-pack(1) spawned is configured with the `--fsck-options` flag
to perform fsck verification. With this flag enabled, there is not a way
to configure fsck message severity though.

Extend the `unbundle_opts` type to store fsck message severity
configuration and update `unbundle()` to conditionally append it to the
`--fsck-objects` flag if provided. This enables `unbundle()` call sites
to support optionally setting the severity for specific fsck messages.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Justin Tobler and committed by
Junio C Hamano
187574ce 87c01003

+14 -6
+7 -6
bundle.c
··· 631 struct unbundle_opts *opts) 632 { 633 struct child_process ip = CHILD_PROCESS_INIT; 634 - enum verify_bundle_flags flags = 0; 635 636 - if (opts) 637 - flags = opts->flags; 638 639 - if (verify_bundle(r, header, flags)) 640 return -1; 641 642 strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL); ··· 645 if (header->filter.choice) 646 strvec_push(&ip.args, "--promisor=from-bundle"); 647 648 - if (flags & VERIFY_BUNDLE_FSCK) 649 - strvec_push(&ip.args, "--fsck-objects"); 650 651 if (extra_index_pack_args) 652 strvec_pushv(&ip.args, extra_index_pack_args->v);
··· 631 struct unbundle_opts *opts) 632 { 633 struct child_process ip = CHILD_PROCESS_INIT; 634 + struct unbundle_opts opts_fallback = { 0 }; 635 636 + if (!opts) 637 + opts = &opts_fallback; 638 639 + if (verify_bundle(r, header, opts->flags)) 640 return -1; 641 642 strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL); ··· 645 if (header->filter.choice) 646 strvec_push(&ip.args, "--promisor=from-bundle"); 647 648 + if (opts->flags & VERIFY_BUNDLE_FSCK) 649 + strvec_pushf(&ip.args, "--fsck-objects%s", 650 + opts->fsck_msg_types ? opts->fsck_msg_types : ""); 651 652 if (extra_index_pack_args) 653 strvec_pushv(&ip.args, extra_index_pack_args->v);
+7
bundle.h
··· 41 42 struct unbundle_opts { 43 enum verify_bundle_flags flags; 44 }; 45 46 /**
··· 41 42 struct unbundle_opts { 43 enum verify_bundle_flags flags; 44 + /* 45 + * fsck_msg_types may optionally contain fsck message severity 46 + * configuration. If present, this configuration gets directly appended 47 + * to a '--fsck-objects' option and therefore must be prefixed with '='. 48 + * (E.g. "=missingEmail=ignore,gitmodulesUrl=ignore") 49 + */ 50 + const char *fsck_msg_types; 51 }; 52 53 /**