mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-19 19:08:08 +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
1 changed files with 6 additions and 8 deletions
|
@ -76,6 +76,11 @@ pub(crate) fn cmd_move(
|
|||
let diff_selector =
|
||||
workspace_command.diff_selector(ui, args.tool.as_deref(), args.interactive)?;
|
||||
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 source_tree = source.tree()?;
|
||||
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_description(description)
|
||||
.write()?;
|
||||
tx.finish(
|
||||
ui,
|
||||
format!(
|
||||
"move changes from {} to {}",
|
||||
source.id().hex(),
|
||||
destination.id().hex()
|
||||
),
|
||||
)?;
|
||||
tx.finish(ui, tx_description)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue