From: Teng Long Date: Thu, 01 Sep 2022 02:56:22 GMT Subject: [PATCH 4/7] bundle-uri: unit test "key=value" parsing Message-ID: <20220901025622.19901-1-tenglong.tl@alibaba-inc.com> In-Reply-To: <7580e1f09aff2acdf7a7cb86bf8dc7e294cffd33.1661181174.git.gitgitgadget@gmail.com> Ævar Arnfjörð Bjarmason writes > +void print_bundle_list(FILE *fp, struct bundle_list *list) > +{ > + const char *mode; > + > + switch (list->mode) { > + case BUNDLE_MODE_ALL: > + mode = "all"; > + break; > + > + case BUNDLE_MODE_ANY: > + mode = "any"; > + break; > + > + case BUNDLE_MODE_NONE: > + default: > + mode = ""; > + } > + > + printf("[bundle]\n"); > + printf("\tversion = %d\n", list->version); > + printf("\tmode = %s\n", mode); > + > + for_all_bundles_in_list(list, summarize_bundle, fp); > +} "print_bundle_list" use to print the git config formatting lines of "bundle_list", it's supported to use a "FILE *fp" as it's output. The "for_all_bundles_in_list" use it, but other places seems not, I'm not sure, maybe we should change to: fprintf(fp, "[bundle]\n"); fprintf(fp, "\tversion = %d\n", list->version); fprintf(fp, "\tmode = %s\n", mode); here? Thanks.