mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'am/trace2-with-valueless-true'
The trace2 code was not prepared to show a configuration variable that is set to true using the valueless true syntax, which has been corrected. * am/trace2-with-valueless-true: trace2: prevent segfault on config collection with valueless true
This commit is contained in:
@@ -493,7 +493,8 @@ static void fn_param_fl(const char *file, int line, const char *param,
|
||||
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
||||
jw_object_string(&jw, "scope", scope_name);
|
||||
jw_object_string(&jw, "param", param);
|
||||
jw_object_string(&jw, "value", value);
|
||||
if (value)
|
||||
jw_object_string(&jw, "value", value);
|
||||
jw_end(&jw);
|
||||
|
||||
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
||||
|
||||
@@ -307,8 +307,9 @@ static void fn_param_fl(const char *file, int line, const char *param,
|
||||
enum config_scope scope = kvi->scope;
|
||||
const char *scope_name = config_scope_name(scope);
|
||||
|
||||
strbuf_addf(&buf_payload, "def_param scope:%s %s=%s", scope_name, param,
|
||||
value);
|
||||
strbuf_addf(&buf_payload, "def_param scope:%s %s", scope_name, param);
|
||||
if (value)
|
||||
strbuf_addf(&buf_payload, "=%s", value);
|
||||
normal_io_write_fl(file, line, &buf_payload);
|
||||
strbuf_release(&buf_payload);
|
||||
}
|
||||
|
||||
@@ -448,8 +448,9 @@ static void fn_param_fl(const char *file, int line, const char *param,
|
||||
struct strbuf scope_payload = STRBUF_INIT;
|
||||
enum config_scope scope = kvi->scope;
|
||||
const char *scope_name = config_scope_name(scope);
|
||||
|
||||
strbuf_addf(&buf_payload, "%s:%s", param, value);
|
||||
strbuf_addstr(&buf_payload, param);
|
||||
if (value)
|
||||
strbuf_addf(&buf_payload, ":%s", value);
|
||||
strbuf_addf(&scope_payload, "%s:%s", "scope", scope_name);
|
||||
|
||||
perf_io_write_fl(file, line, event_name, NULL, NULL, NULL,
|
||||
|
||||
Reference in New Issue
Block a user