]> git.ipfire.org Git - thirdparty/git.git/blobdiff - trace2/tr2_cfg.c
trace2: plumb config kvi
[thirdparty/git.git] / trace2 / tr2_cfg.c
index 83bc4fd109c6131f4638026d82bcdc59ac55448e..733d9d2872ad8645e2a07f86149c4459a8bafe70 100644 (file)
@@ -100,7 +100,7 @@ struct tr2_cfg_data {
  * See if the given config key matches any of our patterns of interest.
  */
 static int tr2_cfg_cb(const char *key, const char *value,
-                     const struct config_context *ctx UNUSED, void *d)
+                     const struct config_context *ctx, void *d)
 {
        struct strbuf **s;
        struct tr2_cfg_data *data = (struct tr2_cfg_data *)d;
@@ -109,7 +109,8 @@ static int tr2_cfg_cb(const char *key, const char *value,
                struct strbuf *buf = *s;
                int wm = wildmatch(buf->buf, key, WM_CASEFOLD);
                if (wm == WM_MATCH) {
-                       trace2_def_param_fl(data->file, data->line, key, value);
+                       trace2_def_param_fl(data->file, data->line, key, value,
+                                           ctx->kvi);
                        return 0;
                }
        }
@@ -127,8 +128,10 @@ void tr2_cfg_list_config_fl(const char *file, int line)
 
 void tr2_list_env_vars_fl(const char *file, int line)
 {
+       struct key_value_info kvi = KVI_INIT;
        struct strbuf **s;
 
+       kvi_from_param(&kvi);
        if (tr2_load_env_vars() <= 0)
                return;
 
@@ -136,7 +139,7 @@ void tr2_list_env_vars_fl(const char *file, int line)
                struct strbuf *buf = *s;
                const char *val = getenv(buf->buf);
                if (val && *val)
-                       trace2_def_param_fl(file, line, buf->buf, val);
+                       trace2_def_param_fl(file, line, buf->buf, val, &kvi);
        }
 }