diff options
| author | Lars Hjemli | 2007-02-08 14:47:56 +0100 |
|---|---|---|
| committer | Lars Hjemli | 2007-02-08 14:47:56 +0100 |
| commit | ac70cb4795c90db02917db63d169b0fadfe9fb99 (patch) | |
| tree | bf7a5c4c8c2789cda2dd511f0a180df279a0b389 /shared.c | |
| parent | ab2ab95f09994560f62fd631f07d3b6e3577aa6e (diff) | |
| download | cgit-ac70cb4795c90db02917db63d169b0fadfe9fb99.tar.gz cgit-ac70cb4795c90db02917db63d169b0fadfe9fb99.tar.bz2 cgit-ac70cb4795c90db02917db63d169b0fadfe9fb99.zip | |
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>
Diffstat (limited to 'shared.c')
| -rw-r--r-- | shared.c | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -20,6 +20,7 @@ char *cgit_virtual_root = NULL; | |||
| 20 | char *cgit_cache_root = "/var/cache/cgit"; | 20 | char *cgit_cache_root = "/var/cache/cgit"; |
| 21 | 21 | ||
| 22 | int cgit_nocache = 0; | 22 | int cgit_nocache = 0; |
| 23 | int cgit_snapshots = 0; | ||
| 23 | int cgit_max_lock_attempts = 5; | 24 | int cgit_max_lock_attempts = 5; |
| 24 | int cgit_cache_root_ttl = 5; | 25 | int cgit_cache_root_ttl = 5; |
| 25 | int cgit_cache_repo_ttl = 5; | 26 | int cgit_cache_repo_ttl = 5; |
| @@ -83,6 +84,7 @@ struct repoinfo *add_repo(const char *url) | |||
| 83 | ret->path = NULL; | 84 | ret->path = NULL; |
| 84 | ret->desc = NULL; | 85 | ret->desc = NULL; |
| 85 | ret->owner = NULL; | 86 | ret->owner = NULL; |
| 87 | ret->snapshots = cgit_snapshots; | ||
| 86 | return ret; | 88 | return ret; |
| 87 | } | 89 | } |
| 88 | 90 | ||
| @@ -100,6 +102,8 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
| 100 | cgit_virtual_root = xstrdup(value); | 102 | cgit_virtual_root = xstrdup(value); |
| 101 | else if (!strcmp(name, "nocache")) | 103 | else if (!strcmp(name, "nocache")) |
| 102 | cgit_nocache = atoi(value); | 104 | cgit_nocache = atoi(value); |
| 105 | else if (!strcmp(name, "snapshots")) | ||
| 106 | cgit_snapshots = atoi(value); | ||
| 103 | else if (!strcmp(name, "cache-root")) | 107 | else if (!strcmp(name, "cache-root")) |
| 104 | cgit_cache_root = xstrdup(value); | 108 | cgit_cache_root = xstrdup(value); |
| 105 | else if (!strcmp(name, "cache-root-ttl")) | 109 | else if (!strcmp(name, "cache-root-ttl")) |
| @@ -122,6 +126,8 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
| 122 | cgit_repo->desc = xstrdup(value); | 126 | cgit_repo->desc = xstrdup(value); |
| 123 | else if (cgit_repo && !strcmp(name, "repo.owner")) | 127 | else if (cgit_repo && !strcmp(name, "repo.owner")) |
| 124 | cgit_repo->owner = xstrdup(value); | 128 | cgit_repo->owner = xstrdup(value); |
| 129 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) | ||
| 130 | cgit_repo->snapshots = atoi(value); | ||
| 125 | } | 131 | } |
| 126 | 132 | ||
| 127 | void cgit_repo_config_cb(const char *name, const char *value) | 133 | void cgit_repo_config_cb(const char *name, const char *value) |
