ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: extract default_diff_format() from diff_format_for()

I'll make "jj log -p --summary" show both summary and diff, where -p will
be resolved to the default diff format.
This commit is contained in:
Yuya Nishihara 2022-12-13 23:06:46 +09:00
parent f26582d0a3
commit cdf3bfa55f

View file

@ -62,12 +62,16 @@ pub fn diff_format_for(ui: &Ui, args: &DiffFormatArgs) -> DiffFormat {
} else if args.color_words {
DiffFormat::ColorWords
} else {
match ui.settings().config().get_string("diff.format").as_deref() {
Ok("summary") => DiffFormat::Summary,
Ok("git") => DiffFormat::Git,
Ok("color-words") => DiffFormat::ColorWords,
_ => DiffFormat::ColorWords,
}
default_diff_format(ui)
}
}
fn default_diff_format(ui: &Ui) -> DiffFormat {
match ui.settings().config().get_string("diff.format").as_deref() {
Ok("summary") => DiffFormat::Summary,
Ok("git") => DiffFormat::Git,
Ok("color-words") => DiffFormat::ColorWords,
_ => DiffFormat::ColorWords,
}
}