From bd24832cd7a72117afb7fa785f4e6bfa4324bf30 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 5 Mar 2015 02:18:42 +0100 Subject: cgit: show clone URLs for empty repo --- cgit.c | 16 ++++++++++++++++ ui-summary.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cgit.c b/cgit.c index 02dddda..0ad8171 100644 --- a/cgit.c +++ b/cgit.c @@ -536,6 +536,17 @@ static void choose_readme(struct cgit_repo *repo) string_list_append(&repo->readme, filename)->util = ref; } +static void print_no_repo_clone_urls(const char *url) +{ + html(""); + html_txt(url); + html("\n"); +} + static int prepare_repo_cmd(void) { unsigned char sha1[20]; @@ -586,6 +597,11 @@ static int prepare_repo_cmd(void) cgit_print_docstart(); cgit_print_pageheader(); cgit_print_error("Repository seems to be empty"); + if (!strcmp(ctx.qry.page, "summary")) { + html("\n"); + cgit_add_clone_urls(print_no_repo_clone_urls); + html("
 
Clone
\n"); + } cgit_print_docend(); return 1; } diff --git a/ui-summary.c b/ui-summary.c index 46ca713..fa5ba04 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -28,7 +28,7 @@ static void print_url(const char *url) if (urls++ == 0) { htmlf(" ", columns); - htmlf("Clone\n", columns); + htmlf("Clone\n", columns); } htmlf("author
path: root/bounce.c (unfollow)
Commit message (Collapse)Author
2020-08-24Use configPath to load client cert/privJune McEnroe
2020-08-24Use configOpen in getopt_configJune McEnroe
2020-08-24Import xdg.c from catgirlJune McEnroe
2020-08-23Replace “RAND_bytes” by “getentropy”Issam E. Maghni
This removes the dependency on libcrypto. Signed-off-by: Issam E. Maghni <issam.e.maghni@mailbox.org>
2020-08-16contrib/palaver: Add no message preview flagsJune McEnroe
2020-08-13contrib/palaver: Don't set channel for PMsJune McEnroe
2020-08-13Fix unintended interception of NICK after registrationJune McEnroe
Another bug caused by trying to support broken clients. I'm annoyed.
2020-08-12Add Additional Components section to READMEJune McEnroe
2020-08-12Document -L / palaver optionJune McEnroe
2020-08-11contrib/palaver: Document service configurationJune McEnroe
2020-08-11contrib/palaver: Add install target and rc scriptJune McEnroe
2020-08-11contrib/palaver: Implement command and notificationsJune McEnroe