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:
parent
f26582d0a3
commit
cdf3bfa55f
1 changed files with 10 additions and 6 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue