]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bundle-uri: send debug output to given FILE * stream
authorJan Mazur <mzr@fb.com>
Wed, 4 Jun 2025 17:11:21 +0000 (17:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Jun 2025 20:19:47 +0000 (13:19 -0700)
d796cedb (bundle-uri: unit test "key=value" parsing, 2022-10-12)
introduced the print_bundle_list() function, which takes a "FILE
*fp" to write the output to.  Later with c93c3d2f (bundle-uri:
parse bundle.heuristic=creationToken, 2023-01-31) the function
started showing additional information, which is always written
to the standard output stream.

It does not look like a deliberate decision to do so, and it
does not hurt, as all callers of the function passes stdout to
it.

We could change the function not to take fp and always write to
the standard output to simplify, but let's use the FILE *fp
provided by the caller consistently to write out output.

Signed-off-by: Jan Mazur <mzr@meta.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle-uri.c

index 8a3c39ce572b6c0fcfcfd07a0fb2f3d6da2bdecc..72e70c51fdd1db4e8c0d6467cfa62617ab7c86d4 100644 (file)
@@ -115,7 +115,7 @@ void print_bundle_list(FILE *fp, struct bundle_list *list)
                int i;
                for (i = 0; i < BUNDLE_HEURISTIC__COUNT; i++) {
                        if (heuristics[i].heuristic == list->heuristic) {
-                               printf("\theuristic = %s\n",
+                               fprintf(fp, "\theuristic = %s\n",
                                       heuristics[list->heuristic].name);
                                break;
                        }