X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a1429dbc89f9c0945e32cea9fd3424d2fe56aeab..521e10c884055c800078e6dada97ccf6c5193aad:/shared.c diff --git a/shared.c b/shared.c index 699c362..3e20937 100644 --- a/shared.c +++ b/shared.c @@ -8,7 +8,6 @@ #include "cgit.h" #include -#include struct cgit_repolist cgit_repolist; struct cgit_context ctx; @@ -34,6 +33,7 @@ int chk_non_negative(int result, char *msg) return result; } +char *cgit_default_repo_desc = "[no description]"; struct cgit_repo *cgit_add_repo(const char *url) { struct cgit_repo *ret; @@ -53,10 +53,9 @@ struct cgit_repo *cgit_add_repo(const char *url) ret->url = trim_end(url, '/'); ret->name = ret->url; ret->path = NULL; - ret->desc = "[no description]"; + ret->desc = cgit_default_repo_desc; ret->owner = NULL; ret->section = ctx.cfg.section; - ret->defbranch = "master"; ret->snapshots = ctx.cfg.snapshots; ret->enable_commit_graph = ctx.cfg.enable_commit_graph; ret->enable_log_filecount = ctx.cfg.enable_log_filecount; @@ -71,6 +70,7 @@ struct cgit_repo *cgit_add_repo(const char *url) ret->commit_filter = ctx.cfg.commit_filter; ret->source_filter = ctx.cfg.source_filter; ret->clone_url = ctx.cfg.clone_url; + ret->submodules.strdup_strings = 1; return ret; } @@ -393,7 +393,7 @@ void cgit_prepare_repo_env(struct cgit_repo * repo) p = env_vars; q = p + env_var_count; for (; p < q; p++) - if (setenv(p->name, p->value, 1)) + if (p->value && setenv(p->name, p->value, 1)) fprintf(stderr, warn, p->name, p->value); }