summaryrefslogtreecommitdiffabout
path: root/shared.c
Side-by-side diff
Diffstat (limited to 'shared.c') (more/less context) (show whitespace changes)
-rw-r--r--shared.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index 5757d0c..531d8c0 100644
--- a/shared.c
+++ b/shared.c
@@ -22,2 +22,3 @@ char *cgit_cache_root = "/var/cache/cgit";
int cgit_nocache = 0;
+int cgit_snapshots = 0;
int cgit_max_lock_attempts = 5;
@@ -85,2 +86,3 @@ struct repoinfo *add_repo(const char *url)
ret->owner = NULL;
+ ret->snapshots = cgit_snapshots;
return ret;
@@ -102,2 +104,4 @@ void cgit_global_config_cb(const char *name, const char *value)
cgit_nocache = atoi(value);
+ else if (!strcmp(name, "snapshots"))
+ cgit_snapshots = atoi(value);
else if (!strcmp(name, "cache-root"))
@@ -124,2 +128,4 @@ void cgit_global_config_cb(const char *name, const char *value)
cgit_repo->owner = xstrdup(value);
+ else if (cgit_repo && !strcmp(name, "repo.snapshots"))
+ cgit_repo->snapshots = atoi(value);
}