diff options
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) | 
