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

style: return early from exceptional situation

This commit is contained in:
Samuel Tardieu 2023-01-29 18:48:59 +01:00
parent fc59db5d52
commit 890327ea68

View file

@ -2580,7 +2580,8 @@ don't make any changes, then the operation will be aborted.
)?;
if &tree_id == commit.tree_id() && interactive {
ui.write("Nothing changed.\n")?;
} else {
return Ok(());
}
let middle_tree = tx
.base_repo()
.store()
@ -2593,8 +2594,7 @@ don't make any changes, then the operation will be aborted.
&base_tree,
&middle_tree,
)?;
let first_description =
edit_description(tx.base_repo(), &first_template, command.settings())?;
let first_description = edit_description(tx.base_repo(), &first_template, command.settings())?;
let first_commit = tx
.mut_repo()
.rewrite_commit(command.settings(), &commit)
@ -2635,7 +2635,6 @@ don't make any changes, then the operation will be aborted.
tx.write_commit_summary(ui.stdout_formatter().as_mut(), &second_commit)?;
ui.write("\n")?;
tx.finish(ui)?;
}
Ok(())
}