|
diff --git a/shared.c b/shared.c index ce3ca4f..e3123a8 100644 --- a/ shared.c+++ b/ shared.c |
|
@@ -102,16 +102,17 @@ struct repoinfo *add_repo(const char *url) |
102 | ret->desc = NULL; |
102 | ret->desc = NULL; |
103 | ret->owner = NULL; |
103 | ret->owner = NULL; |
104 | ret->group = cgit_repo_group; |
104 | ret->group = cgit_repo_group; |
105 | ret->defbranch = "master"; |
105 | ret->defbranch = "master"; |
106 | ret->snapshots = cgit_snapshots; |
106 | ret->snapshots = cgit_snapshots; |
107 | ret->enable_log_filecount = cgit_enable_log_filecount; |
107 | ret->enable_log_filecount = cgit_enable_log_filecount; |
108 | ret->enable_log_linecount = cgit_enable_log_linecount; |
108 | ret->enable_log_linecount = cgit_enable_log_linecount; |
109 | ret->module_link = cgit_module_link; |
109 | ret->module_link = cgit_module_link; |
| |
110 | ret->readme = NULL; |
110 | return ret; |
111 | return ret; |
111 | } |
112 | } |
112 | |
113 | |
113 | struct repoinfo *cgit_get_repoinfo(const char *url) |
114 | struct repoinfo *cgit_get_repoinfo(const char *url) |
114 | { |
115 | { |
115 | int i; |
116 | int i; |
116 | struct repoinfo *repo; |
117 | struct repoinfo *repo; |
117 | |
118 | |
@@ -182,17 +183,22 @@ void cgit_global_config_cb(const char *name, const char *value) |
182 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) |
183 | else if (cgit_repo && !strcmp(name, "repo.snapshots")) |
183 | cgit_repo->snapshots = cgit_snapshots * atoi(value); |
184 | cgit_repo->snapshots = cgit_snapshots * atoi(value); |
184 | else if (cgit_repo && !strcmp(name, "repo.enable-log-filecount")) |
185 | else if (cgit_repo && !strcmp(name, "repo.enable-log-filecount")) |
185 | cgit_repo->enable_log_filecount = cgit_enable_log_filecount * atoi(value); |
186 | cgit_repo->enable_log_filecount = cgit_enable_log_filecount * atoi(value); |
186 | else if (cgit_repo && !strcmp(name, "repo.enable-log-linecount")) |
187 | else if (cgit_repo && !strcmp(name, "repo.enable-log-linecount")) |
187 | cgit_repo->enable_log_linecount = cgit_enable_log_linecount * atoi(value); |
188 | cgit_repo->enable_log_linecount = cgit_enable_log_linecount * atoi(value); |
188 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
189 | else if (cgit_repo && !strcmp(name, "repo.module-link")) |
189 | cgit_repo->module_link= xstrdup(value); |
190 | cgit_repo->module_link= xstrdup(value); |
190 | else if (!strcmp(name, "include")) |
191 | else if (cgit_repo && !strcmp(name, "repo.readme") && value != NULL) { |
| |
192 | if (*value == '/') |
| |
193 | cgit_repo->readme = xstrdup(value); |
| |
194 | else |
| |
195 | cgit_repo->readme = xstrdup(fmt("%s/%s", cgit_repo->path, value)); |
| |
196 | } else if (!strcmp(name, "include")) |
191 | cgit_read_config(value, cgit_global_config_cb); |
197 | cgit_read_config(value, cgit_global_config_cb); |
192 | } |
198 | } |
193 | |
199 | |
194 | void cgit_querystring_cb(const char *name, const char *value) |
200 | void cgit_querystring_cb(const char *name, const char *value) |
195 | { |
201 | { |
196 | if (!strcmp(name,"r")) { |
202 | if (!strcmp(name,"r")) { |
197 | cgit_query_repo = xstrdup(value); |
203 | cgit_query_repo = xstrdup(value); |
198 | cgit_repo = cgit_get_repoinfo(value); |
204 | cgit_repo = cgit_get_repoinfo(value); |
|