|
diff --git a/shared.c b/shared.c index 752ceac..53cd9b0 100644 --- a/ shared.c+++ b/ shared.c |
|
@@ -21,8 +21,10 @@ char *cgit_script_name = CGIT_SCRIPT_NAME; |
21 | char *cgit_cache_root = "/var/cache/cgit"; |
21 | char *cgit_cache_root = "/var/cache/cgit"; |
22 | |
22 | |
23 | int cgit_nocache = 0; |
23 | int cgit_nocache = 0; |
24 | int cgit_snapshots = 0; |
24 | int cgit_snapshots = 0; |
| |
25 | int cgit_enable_log_filecount = 0; |
| |
26 | int cgit_enable_log_linecount = 0; |
25 | int cgit_max_lock_attempts = 5; |
27 | int cgit_max_lock_attempts = 5; |
26 | int cgit_cache_root_ttl = 5; |
28 | int cgit_cache_root_ttl = 5; |
27 | int cgit_cache_repo_ttl = 5; |
29 | int cgit_cache_repo_ttl = 5; |
28 | int cgit_cache_dynamic_ttl = 5; |
30 | int cgit_cache_dynamic_ttl = 5; |
@@ -84,8 +86,10 @@ struct repoinfo *add_repo(const char *url) |
84 | ret->desc = NULL; |
86 | ret->desc = NULL; |
85 | ret->owner = NULL; |
87 | ret->owner = NULL; |
86 | ret->defbranch = "master"; |
88 | ret->defbranch = "master"; |
87 | ret->snapshots = cgit_snapshots; |
89 | ret->snapshots = cgit_snapshots; |
| |
90 | ret->enable_log_filecount = cgit_enable_log_filecount; |
| |
91 | ret->enable_log_linecount = cgit_enable_log_linecount; |
88 | ret->module_link = cgit_module_link; |
92 | ret->module_link = cgit_module_link; |
89 | return ret; |
93 | return ret; |
90 | } |
94 | } |
91 | |
95 | |
@@ -106,8 +110,12 @@ void cgit_global_config_cb(const char *name, const char *value) |
106 | else if (!strcmp(name, "nocache")) |
110 | else if (!strcmp(name, "nocache")) |
107 | cgit_nocache = atoi(value); |
111 | cgit_nocache = atoi(value); |
108 | else if (!strcmp(name, "snapshots")) |
112 | else if (!strcmp(name, "snapshots")) |
109 | cgit_snapshots = atoi(value); |
113 | cgit_snapshots = atoi(value); |
| |
114 | else if (!strcmp(name, "enable-log-filecount")) |
| |
115 | cgit_enable_log_filecount = atoi(value); |
| |
116 | else if (!strcmp(name, "enable-log-linecount")) |
| |
117 | cgit_enable_log_linecount = atoi(value); |
110 | else if (!strcmp(name, "cache-root")) |
118 | else if (!strcmp(name, "cache-root")) |
111 | cgit_cache_root = xstrdup(value); |
119 | cgit_cache_root = xstrdup(value); |
112 | else if (!strcmp(name, "cache-root-ttl")) |
120 | else if (!strcmp(name, "cache-root-ttl")) |
113 | cgit_cache_root_ttl = atoi(value); |
121 | cgit_cache_root_ttl = atoi(value); |
@@ -135,9 +143,13 @@ void cgit_global_config_cb(const char *name, const char *value) |
135 | cgit_repo->owner = xstrdup(value); |
143 | cgit_repo->owner = xstrdup(value); |
136 | else if (cgit_repo && !strcmp(name, "repo.defbranch")) |
144 | else if (cgit_repo && !strcmp(name, "repo.defbranch")) |
137 | cgit_repo->defbranch = xstrdup(value); |
145 | cgit_repo->defbranch = xstrdup(value); |
138 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) |
146 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) |
139 | cgit_repo->snapshots = atoi(value); |
147 | cgit_repo->snapshots = cgit_snapshots * atoi(value); |
| |
148 | else if (cgit_repo && !strcmp(name, "repo.enable-log-filecount")) |
| |
149 | cgit_repo->enable_log_filecount = cgit_enable_log_filecount * atoi(value); |
| |
150 | else if (cgit_repo && !strcmp(name, "repo.enable-log-linecount")) |
| |
151 | cgit_repo->enable_log_linecount = cgit_enable_log_linecount * atoi(value); |
140 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
152 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
141 | cgit_repo->module_link= xstrdup(value); |
153 | cgit_repo->module_link= xstrdup(value); |
142 | else if (!strcmp(name, "include")) |
154 | else if (!strcmp(name, "include")) |
143 | cgit_read_config(value, cgit_global_config_cb); |
155 | cgit_read_config(value, cgit_global_config_cb); |
|