mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-30 19:32:39 +00:00
cli describe: move use_editor
variable closer to use sites
This commit is contained in:
parent
12c1a552cd
commit
459ed85f62
@ -152,11 +152,6 @@ pub(crate) fn cmd_describe(
|
||||
None
|
||||
};
|
||||
|
||||
// edit and no_edit are conflicting arguments and therefore it should not
|
||||
// be possible for both to be true at the same time.
|
||||
assert!(!(args.edit && args.no_edit));
|
||||
let use_editor = args.edit || (shared_description.is_none() && !args.no_edit);
|
||||
|
||||
let mut commit_builders = commits
|
||||
.iter()
|
||||
.map(|commit| {
|
||||
@ -180,6 +175,11 @@ pub(crate) fn cmd_describe(
|
||||
})
|
||||
.collect_vec();
|
||||
|
||||
// edit and no_edit are conflicting arguments and therefore it should not
|
||||
// be possible for both to be true at the same time.
|
||||
assert!(!(args.edit && args.no_edit));
|
||||
let use_editor = args.edit || (shared_description.is_none() && !args.no_edit);
|
||||
|
||||
if let Some(trailer_template) = parse_trailers_template(ui, &tx)? {
|
||||
for commit_builder in &mut commit_builders {
|
||||
// The first trailer would become the first line of the description.
|
||||
|
Loading…
x
Reference in New Issue
Block a user