X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/96ceb9a95a7a321209cff347fefd141a9fffc7ca..8eef4589d0ba80fd4e6a9ce2f3ca4fcf266a64e0:/cgit.c
diff --git a/cgit.c b/cgit.c
index 79019c2..c16ed8c 100644
--- a/cgit.c
+++ b/cgit.c
@@ -93,6 +93,10 @@ static void repo_config(struct cgit_repo *repo, const char *name, const char *va
repo->email_filter = cgit_new_filter(value, EMAIL);
else if (!strcmp(name, "owner-filter"))
repo->owner_filter = cgit_new_filter(value, OWNER);
+ } else if (!strcmp(name, "hide")) {
+ repo->hide = atoi(value);
+ } else if (!strcmp(name, "ignore")) {
+ repo->ignore = atoi(value);
}
}
@@ -532,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];
@@ -582,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("| |
| Clone |
\n");
+ cgit_add_clone_urls(print_no_repo_clone_urls);
+ html("
\n");
+ }
cgit_print_docend();
return 1;
}
@@ -599,7 +619,7 @@ static int prepare_repo_cmd(void)
free(tmp);
return 1;
}
- sort_string_list(&ctx.repo->submodules);
+ string_list_sort(&ctx.repo->submodules);
cgit_prepare_repo_env(ctx.repo);
choose_readme(ctx.repo);
return 0;
@@ -828,6 +848,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo)
else if (repo->commit_sort == 2)
fprintf(f, "repo.commit-sort=topo\n");
}
+ fprintf(f, "repo.hide=%d\n", repo->hide);
+ fprintf(f, "repo.ignore=%d\n", repo->ignore);
fprintf(f, "\n");
}
@@ -991,7 +1013,7 @@ static void cgit_parse_args(int argc, const char **argv)
}
}
-static int calc_ttl()
+static int calc_ttl(void)
{
if (!ctx.repo)
return ctx.cfg.cache_root_ttl;