mirror of
https://git.zx2c4.com/cgit
synced 2025-08-28 13:48:14 +02:00
Make snapshot feature configurable
Snapshots can now be enabled/disabled by default for all repositories in cgitrc with param "snapshots". Additionally, any repo can override the default setting with param "repo.snapshots". By default, no snapshotting is enabled. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
parent
ab2ab95f09
commit
ac70cb4795
5 changed files with 22 additions and 6 deletions
3
cgit.c
3
cgit.c
|
@ -79,7 +79,8 @@ static void cgit_print_repo_page(struct cacheitem *item)
|
|||
show_search = 0;
|
||||
setenv("GIT_DIR", cgit_repo->path, 1);
|
||||
|
||||
if (cgit_query_page && !strcmp(cgit_query_page, "snapshot")) {
|
||||
if (cgit_repo->snapshots && cgit_query_page &&
|
||||
!strcmp(cgit_query_page, "snapshot")) {
|
||||
cgit_print_snapshot(item, cgit_query_sha1, "zip",
|
||||
cgit_repo->url, cgit_query_name);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue