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 | |
parent | cache: use F_SETLK to avoid stale lock files (diff) | |
download | cgit-bd24832cd7a72117afb7fa785f4e6bfa4324bf30.tar.gz cgit-bd24832cd7a72117afb7fa785f4e6bfa4324bf30.zip |
cgit: show clone URLs for empty repo
-rw-r--r-- | cgit.c | 16 | ||||
-rw-r--r-- | ui-summary.c | 2 |
2 files changed, 17 insertions, 1 deletions
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) | |||
536 | string_list_append(&repo->readme, filename)->util = ref; | 536 | string_list_append(&repo->readme, filename)->util = ref; |
537 | } | 537 | } |
538 | 538 | ||
539 | static void print_no_repo_clone_urls(const char *url) | ||
540 | { | ||
541 | html("<tr><td><a rel='vcs-git' href='"); | ||
542 | html_url_path(url); | ||
543 | html("' title='"); | ||
544 | html_attr(ctx.repo->name); | ||
545 | html(" Git repository'>"); | ||
546 | html_txt(url); | ||
547 | html("</a></td></tr>\n"); | ||
548 | } | ||
549 | |||
539 | static int prepare_repo_cmd(void) | 550 | static int prepare_repo_cmd(void) |
540 | { | 551 | { |
541 | unsigned char sha1[20]; | 552 | unsigned char sha1[20]; |
@@ -586,6 +597,11 @@ static int prepare_repo_cmd(void) | |||
586 | cgit_print_docstart(); | 597 | cgit_print_docstart(); |
587 | cgit_print_pageheader(); | 598 | cgit_print_pageheader(); |
588 | cgit_print_error("Repository seems to be empty"); | 599 | cgit_print_error("Repository seems to be empty"); |
600 | if (!strcmp(ctx.qry.page, "summary")) { | ||
601 | html("<table class='list'><tr class='nohover'><td> </td></tr><tr class='nohover'><th class='left'>Clone</th></tr>\n"); | ||
602 | cgit_add_clone_urls(print_no_repo_clone_urls); | ||
603 | html("</table>\n"); | ||
604 | } | ||
589 | cgit_print_docend(); | 605 | cgit_print_docend(); |
590 | return 1; | 606 | return 1; |
591 | } | 607 | } |
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) | |||
28 | 28 | ||
29 | if (urls++ == 0) { | 29 | if (urls++ == 0) { |
30 | htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns); | 30 | htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns); |
31 | htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns); | 31 | htmlf("<tr class='nohover'><th class='left' colspan='%d'>Clone</th></tr>\n", columns); |
32 | } | 32 | } |
33 | 33 | ||
34 | htmlf("<tr><td colspan='%d'><a rel='vcs-git' href='", columns); | 34 | htmlf("<tr><td colspan='%d'><a rel='vcs-git' href='", columns); |