]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
Support refspecs in about-filter.
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index f9a42bb77d2551fc670c8d4cf58607b129c41495..4f2c752fd0d2f88bfa9f0b05e672588e3adfd99a 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -1,6 +1,7 @@
 /* cgit.c: cgi for the git scm
  *
  * Copyright (C) 2006 Lars Hjemli
+ * Copyright (C) 2010 Jason A. Donenfeld <Jason@zx2c4.com>
  *
  * Licensed under GNU General Public License v2
  *   (see COPYING for full license text)
@@ -71,7 +72,8 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
        else if (!strcmp(name, "section"))
                repo->section = xstrdup(value);
        else if (!strcmp(name, "readme") && value != NULL) {
-               if (*value == '/')
+               char *colon;
+               if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0'))
                        repo->readme = xstrdup(value);
                else
                        repo->readme = xstrdup(fmt("%s/%s", repo->path, value));
@@ -135,6 +137,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.snapshots = cgit_parse_snapshots_mask(value);
        else if (!strcmp(name, "enable-filter-overrides"))
                ctx.cfg.enable_filter_overrides = atoi(value);
+       else if (!strcmp(name, "enable-gitweb-owner"))
+               ctx.cfg.enable_gitweb_owner = atoi(value);
        else if (!strcmp(name, "enable-index-links"))
                ctx.cfg.enable_index_links = atoi(value);
        else if (!strcmp(name, "enable-log-filecount"))
@@ -293,6 +297,7 @@ static void prepare_context(struct cgit_context *ctx)
        ctx->cfg.css = "/cgit.css";
        ctx->cfg.logo = "/cgit.png";
        ctx->cfg.local_time = 0;
+       ctx->cfg.enable_gitweb_owner = 1;
        ctx->cfg.enable_tree_linenumbers = 1;
        ctx->cfg.max_repo_count = 50;
        ctx->cfg.max_commit_count = 50;