diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to 'source/ui-shared.c')
-rw-r--r--source/ui-shared.c2
1 file changed, 1 insertion, 1 deletion
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.