/* * The page a repository with no commits falls back to, an error line and then * the clone urls someone needs in order to push the first commit. cgit.c * prints this in place of whatever page was asked for as soon as it finds * there is no branch to resolve, so none of the ref driven pages ever run * against an empty repository. */ #include "cgit.h" #include "html.h" #include "ui-empty.h" #include "ui-shared.h" static void print_clone_url(const char *url) { cgit_print_clone_row(url, 0); } /* * The caller has already prepared the repo environment, which the clone urls * need for macro expansion. */ void cgit_print_empty_repo(void) { cgit_print_error("Repository seems to be empty"); // cgit_add_clone_urls draws on these two alone, so with neither set // the table below would be a Clone heading with no rows. if (!ctx.repo->clone_url && !ctx.cfg.clone_prefix) return; html("\n"); html("\n"); cgit_add_clone_urls(print_clone_url); html("
Clone
\n"); }