]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs: dereference the value of the required pointer
authorGreg Funni <gfunni234@gmail.com>
Thu, 18 Dec 2025 16:10:49 +0000 (16:10 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Dec 2025 03:55:38 +0000 (12:55 +0900)
Currently, this always prints yes because required is non-null.

This is the wrong behavior. The boolean must be
dereferenced.

Signed-off-by: Greg Funni <gfunni234@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/debug.c

index 36f8c58b6c781f1d35357a25731337285faa125b..f3d1079a2c805cca9648541a339e38c882138804 100644 (file)
@@ -131,7 +131,7 @@ static int debug_optimize_required(struct ref_store *ref_store,
        struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
        int res = drefs->refs->be->optimize_required(drefs->refs, opts, required);
        trace_printf_key(&trace_refs, "optimize_required: %s, res: %d\n",
-                        required ? "yes" : "no", res);
+                        *required ? "yes" : "no", res);
        return res;
 }