From 804b5b6172f1f8cda1c118c30cc257299bda8ee6 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 2 Aug 2026 09:47:00 -1000 Subject: Give empty repositories their own page --- source/ui-shared.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index d023243..e53d1e5 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1086,7 +1086,9 @@ static void print_header(void) html_txt(ctx.cfg.root_title); html("\n"); - if (ctx.repo && ctx.env.authenticated) { + // A repository with no commits has no branches to list, so the + // switcher would be an empty select next to a switch button. + if (ctx.repo && ctx.env.authenticated && !ctx.empty_repo) { html("
\n"); cgit_add_hidden_formfields(0, 1, ctx.qry.page); html("