cli: config: update default template for multi-line overridden values

This commit is contained in:
Yuya Nishihara 2024-05-21 20:24:48 +09:00
parent ef8038f60f
commit 06f488a8f6
2 changed files with 21 additions and 7 deletions

View file

@ -15,13 +15,9 @@ if(remote,
commit_summary = 'format_commit_summary_with_refs(self, branches)'
config_list = '''
label(if(overridden, "overridden"),
concat(
if(overridden, "# "),
name,
"=",
value,
),
if(overridden,
label("overridden", indent("# ", name ++ "=" ++ value)),
name ++ "=" ++ value,
) ++ "\n"
'''

View file

@ -156,6 +156,24 @@ bar
bar
"""
"###);
let stdout = test_env.jj_cmd_success(
test_env.env_root(),
&[
"config",
"list",
"multiline",
"--include-overridden",
"--config-toml=multiline='single'",
],
);
insta::assert_snapshot!(stdout, @r###"
# multiline="""
# foo
# bar
# """
multiline="single"
"###);
}
#[test]