mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-30 11:31:13 +00:00
move: don't use transient commit in operation description
The `destination` variable we use when creating the operation log may have been replaced earlier in the code. I think this was a regression when I moved the setting of the description from `start_transaction()` to `finish_transaction()` a while ago.
This commit is contained in:
parent
4d42604913
commit
7f101c4023
@ -76,6 +76,11 @@ pub(crate) fn cmd_move(
|
|||||||
let diff_selector =
|
let diff_selector =
|
||||||
workspace_command.diff_selector(ui, args.tool.as_deref(), args.interactive)?;
|
workspace_command.diff_selector(ui, args.tool.as_deref(), args.interactive)?;
|
||||||
let mut tx = workspace_command.start_transaction();
|
let mut tx = workspace_command.start_transaction();
|
||||||
|
let tx_description = format!(
|
||||||
|
"move changes from {} to {}",
|
||||||
|
source.id().hex(),
|
||||||
|
destination.id().hex()
|
||||||
|
);
|
||||||
let parent_tree = merge_commit_trees(tx.repo(), &source.parents())?;
|
let parent_tree = merge_commit_trees(tx.repo(), &source.parents())?;
|
||||||
let source_tree = source.tree()?;
|
let source_tree = source.tree()?;
|
||||||
let instructions = format!(
|
let instructions = format!(
|
||||||
@ -141,13 +146,6 @@ from the source will be moved into the destination.
|
|||||||
.set_tree_id(new_destination_tree.id().clone())
|
.set_tree_id(new_destination_tree.id().clone())
|
||||||
.set_description(description)
|
.set_description(description)
|
||||||
.write()?;
|
.write()?;
|
||||||
tx.finish(
|
tx.finish(ui, tx_description)?;
|
||||||
ui,
|
|
||||||
format!(
|
|
||||||
"move changes from {} to {}",
|
|
||||||
source.id().hex(),
|
|
||||||
destination.id().hex()
|
|
||||||
),
|
|
||||||
)?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user