X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/687cdf69689edcaff8e9035af93baf1a9e71cf32..c330a2e5f86e1f77d3b724877935e11014cefa21:/scan-tree.c diff --git a/scan-tree.c b/scan-tree.c index b5a10ff..08f3f1d 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -55,14 +55,18 @@ static void repo_config(const char *name, const char *value) static int gitconfig_config(const char *key, const char *value, void *cb) { + const char *name; + if (!strcmp(key, "gitweb.owner")) config_fn(repo, "owner", value); else if (!strcmp(key, "gitweb.description")) config_fn(repo, "desc", value); else if (!strcmp(key, "gitweb.category")) config_fn(repo, "section", value); - else if (starts_with(key, "cgit.")) - config_fn(repo, key + 5, value); + else if (!strcmp(key, "gitweb.homepage")) + config_fn(repo, "homepage", value); + else if (skip_prefix(key, "cgit.", &name)) + config_fn(repo, name, value); return 0; } @@ -244,7 +248,7 @@ void scan_projects(const char *path, const char *projectsfile, repo_config_fn fn projectsfile, strerror(errno), errno); return; } - while (strbuf_getline(&line, projects, '\n') != EOF) { + while (strbuf_getline(&line, projects) != EOF) { if (!line.len) continue; strbuf_insert(&line, 0, "/", 1);