mirror of
https://github.com/martinvonz/jj.git
synced 2024-10-24 23:47:22 +00:00
cli: simply assign result of if expression in cmd_describe()
This commit is contained in:
parent
2550dcae4c
commit
48cf32f559
1 changed files with 5 additions and 6 deletions
|
@ -1871,17 +1871,16 @@ fn cmd_describe(
|
|||
let mut workspace_command = command.workspace_helper(ui)?;
|
||||
let commit = workspace_command.resolve_single_rev(&args.revision)?;
|
||||
workspace_command.check_rewriteable(&commit)?;
|
||||
let description;
|
||||
if args.stdin {
|
||||
let description = if args.stdin {
|
||||
let mut buffer = String::new();
|
||||
io::stdin().read_to_string(&mut buffer).unwrap();
|
||||
description = buffer;
|
||||
buffer
|
||||
} else if let Some(message) = &args.message {
|
||||
description = message.into()
|
||||
message.into()
|
||||
} else {
|
||||
let template = description_template_for_commit(&workspace_command, &commit)?;
|
||||
description = edit_description(ui, workspace_command.repo(), &template)?;
|
||||
}
|
||||
edit_description(ui, workspace_command.repo(), &template)?
|
||||
};
|
||||
if description == *commit.description() {
|
||||
ui.write("Nothing changed.\n")?;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue