From f3410dc3f6eb944d0db055a8944f7d1bd7b5fc53 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 10 Oct 2026 11:44:19 -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 2.12.1