author | Lars Hjemli <hjemli@gmail.com> | 2007-02-08 13:47:56 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-02-08 13:47:56 (UTC) |
commit | ac70cb4795c90db02917db63d169b0fadfe9fb99 (patch) (side-by-side diff) | |
tree | bf7a5c4c8c2789cda2dd511f0a180df279a0b389 /shared.c | |
parent | ab2ab95f09994560f62fd631f07d3b6e3577aa6e (diff) | |
download | cgit-ac70cb4795c90db02917db63d169b0fadfe9fb99.zip cgit-ac70cb4795c90db02917db63d169b0fadfe9fb99.tar.gz cgit-ac70cb4795c90db02917db63d169b0fadfe9fb99.tar.bz2 |
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>
-rw-r--r-- | shared.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); } |