From 2767bfb2ea383196d0f5a787ed2a7c9ee11e73dc Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 12:53:15 -1000 Subject: Read a negative ref count as no limit summary-branches, summary-tags and max-ref-count already listed every ref at 0, but a negative value reached qsort as a count and crashed the summary and refs pages, and emptied the branch switcher. --- source/ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index 409ad40..7d28c39 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -485,7 +485,7 @@ static int print_branch_option(const struct reference *ref, void *data) const char *name = ref->name; // The switcher runs on every page, so it is bounded like the refs list. - if (ctx.cfg.max_ref_count && opt->count >= ctx.cfg.max_ref_count) + if (ctx.cfg.max_ref_count > 0 && opt->count >= ctx.cfg.max_ref_count) return -1; // A name spelled like an option is refused as a head, so offering it // would only lead to an error page. -- cgit