refs: dereference the value of the required pointer
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>
Greg Funni committed
Dec 18, 2025 at 16:10 UTC
46d0ee2d6996779bf33acb83e36240443e27c79e
1 file changed
+1
-1
refs/debug.c
+1
-1
index 36f8c58b6c..f3d1079a2c 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -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;
}