Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Report a word where cgitrc expects a number
atoi reads "yes" or "true" as 0, so repo.hide=yes, or cgit.hide true
in a scanned repository's git config, silently did nothing. The values
keep that meaning, since honouring them now would hide repositories on
upgrade, but each one is logged with its file and line.
Diffstat (limited to 'source/scan-tree.c')
| -rw-r--r-- | source/scan-tree.c | 8 |
1 file changed, 7 insertions, 1 deletion
diff --git a/source/scan-tree.c b/source/scan-tree.c index 91db419..6c1f854 100644 --- a/source/scan-tree.c +++ b/source/scan-tree.c @@ -75,13 +75,18 @@ static int trusted_key(const char *name, const char *value) } static int apply_gitconfig(const char *key, const char *value, - const struct config_context *cfg_ctx UNUSED, void *cb UNUSED) + const struct config_context *cfg_ctx, void *cb UNUSED) { + // The scan runs from inside a line of cgitrc, which a warning about + // this value must not be pinned to. + struct config_origin outer = config_origin; const char *name; // A key with no value is legal git config and nothing here can use it. if (!value) return 0; + config_origin.file = cfg_ctx->kvi->filename; + config_origin.line = cfg_ctx->kvi->linenr; if (!strcmp(key, "gitweb.owner")) cgit_repo_config(current_repo, "owner", value); else if (!strcmp(key, "gitweb.description")) @@ -90,6 +95,7 @@ static int apply_gitconfig(const char *key, const char *value, cgit_repo_config(current_repo, "section", value); else if (skip_prefix(key, "cgit.", &name) && trusted_key(name, value)) cgit_repo_config(current_repo, name, value); + config_origin = outer; return 0; } |
