diff options
Diffstat (limited to 'shared.c')
-rw-r--r-- | shared.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -26,6 +26,8 @@ char *cgit_virtual_root = NULL; | |||
26 | char *cgit_script_name = CGIT_SCRIPT_NAME; | 26 | char *cgit_script_name = CGIT_SCRIPT_NAME; |
27 | char *cgit_cache_root = CGIT_CACHE_ROOT; | 27 | char *cgit_cache_root = CGIT_CACHE_ROOT; |
28 | char *cgit_repo_group = NULL; | 28 | char *cgit_repo_group = NULL; |
29 | char *cgit_robots = "index, nofollow"; | ||
30 | char *cgit_clone_prefix = NULL; | ||
29 | 31 | ||
30 | int cgit_nocache = 0; | 32 | int cgit_nocache = 0; |
31 | int cgit_snapshots = 0; | 33 | int cgit_snapshots = 0; |
@@ -68,7 +70,7 @@ int htmlfd = 0; | |||
68 | int cgit_get_cmd_index(const char *cmd) | 70 | int cgit_get_cmd_index(const char *cmd) |
69 | { | 71 | { |
70 | static char *cmds[] = {"log", "commit", "diff", "tree", "blob", | 72 | static char *cmds[] = {"log", "commit", "diff", "tree", "blob", |
71 | "snapshot", "tag", "refs", NULL}; | 73 | "snapshot", "tag", "refs", "patch", NULL}; |
72 | int i; | 74 | int i; |
73 | 75 | ||
74 | for(i = 0; cmds[i]; i++) | 76 | for(i = 0; cmds[i]; i++) |
@@ -197,6 +199,10 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
197 | cgit_agefile = xstrdup(value); | 199 | cgit_agefile = xstrdup(value); |
198 | else if (!strcmp(name, "renamelimit")) | 200 | else if (!strcmp(name, "renamelimit")) |
199 | cgit_renamelimit = atoi(value); | 201 | cgit_renamelimit = atoi(value); |
202 | else if (!strcmp(name, "robots")) | ||
203 | cgit_robots = xstrdup(value); | ||
204 | else if (!strcmp(name, "clone-prefix")) | ||
205 | cgit_clone_prefix = xstrdup(value); | ||
200 | else if (!strcmp(name, "repo.group")) | 206 | else if (!strcmp(name, "repo.group")) |
201 | cgit_repo_group = xstrdup(value); | 207 | cgit_repo_group = xstrdup(value); |
202 | else if (!strcmp(name, "repo.url")) | 208 | else if (!strcmp(name, "repo.url")) |
@@ -205,6 +211,8 @@ void cgit_global_config_cb(const char *name, const char *value) | |||
205 | cgit_repo->name = xstrdup(value); | 211 | cgit_repo->name = xstrdup(value); |
206 | else if (cgit_repo && !strcmp(name, "repo.path")) | 212 | else if (cgit_repo && !strcmp(name, "repo.path")) |
207 | cgit_repo->path = trim_end(value, '/'); | 213 | cgit_repo->path = trim_end(value, '/'); |
214 | else if (cgit_repo && !strcmp(name, "repo.clone-url")) | ||
215 | cgit_repo->clone_url = xstrdup(value); | ||
208 | else if (cgit_repo && !strcmp(name, "repo.desc")) | 216 | else if (cgit_repo && !strcmp(name, "repo.desc")) |
209 | cgit_repo->desc = xstrdup(value); | 217 | cgit_repo->desc = xstrdup(value); |
210 | else if (cgit_repo && !strcmp(name, "repo.owner")) | 218 | else if (cgit_repo && !strcmp(name, "repo.owner")) |
@@ -267,6 +275,8 @@ void *cgit_free_commitinfo(struct commitinfo *info) | |||
267 | free(info->committer); | 275 | free(info->committer); |
268 | free(info->committer_email); | 276 | free(info->committer_email); |
269 | free(info->subject); | 277 | free(info->subject); |
278 | free(info->msg); | ||
279 | free(info->msg_encoding); | ||
270 | free(info); | 280 | free(info); |
271 | return NULL; | 281 | return NULL; |
272 | } | 282 | } |
@@ -482,7 +492,7 @@ void cgit_diff_tree(const unsigned char *old_sha1, | |||
482 | opt.output_format = DIFF_FORMAT_CALLBACK; | 492 | opt.output_format = DIFF_FORMAT_CALLBACK; |
483 | opt.detect_rename = 1; | 493 | opt.detect_rename = 1; |
484 | opt.rename_limit = cgit_renamelimit; | 494 | opt.rename_limit = cgit_renamelimit; |
485 | opt.recursive = 1; | 495 | DIFF_OPT_SET(&opt, RECURSIVE); |
486 | opt.format_callback = cgit_diff_tree_cb; | 496 | opt.format_callback = cgit_diff_tree_cb; |
487 | opt.format_callback_data = fn; | 497 | opt.format_callback_data = fn; |
488 | if (prefix) { | 498 | if (prefix) { |