diff options
author | Jason A. Donenfeld | 2015-03-05 02:18:42 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2015-03-05 02:32:13 +0100 |
commit | bd24832cd7a72117afb7fa785f4e6bfa4324bf30 (patch) | |
tree | 88da55b85154484c45b98b8dad560c3ff117a6dd /cgit.c | |
parent | db9a70b159a107da29f88865d63ba14dd127556f (diff) | |
download | cgit-bd24832cd7a72117afb7fa785f4e6bfa4324bf30.tar cgit-bd24832cd7a72117afb7fa785f4e6bfa4324bf30.tar.gz cgit-bd24832cd7a72117afb7fa785f4e6bfa4324bf30.zip |
cgit: show clone URLs for empty repo
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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("<tr><td><a rel='vcs-git' href='"); + html_url_path(url); + html("' title='"); + html_attr(ctx.repo->name); + html(" Git repository'>"); + html_txt(url); + html("</a></td></tr>\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("<table class='list'><tr class='nohover'><td> </td></tr><tr class='nohover'><th class='left'>Clone</th></tr>\n"); + cgit_add_clone_urls(print_no_repo_clone_urls); + html("</table>\n"); + } cgit_print_docend(); return 1; } |