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

cli: fix operation id recorded on unmanaged Git HEAD move

This appears to be broken at db0d14569b "cli: wrap repo in a struct to
prepare for adding cached data." Testing this isn't easy since the operation
id recorded here will be overwritten immediately by snapshot_working_copy(),
and the snapshotting should work fine so long as the tree id matches.
This commit is contained in:
Yuya Nishihara 2023-09-19 20:19:44 +09:00
parent 96cb3a6053
commit aa3dfaa859

View file

@ -802,7 +802,6 @@ impl WorkspaceCommandHelper {
match new_git_head.as_normal() {
Some(new_git_head_id) if new_git_head != old_git_head => {
let workspace_id = self.workspace_id().to_owned();
let op_id = self.repo().op_id().clone();
if let Some(old_wc_commit_id) =
self.repo().view().get_wc_commit_id(&workspace_id)
{
@ -821,7 +820,7 @@ impl WorkspaceCommandHelper {
locked_working_copy.reset(&new_git_head_tree)?;
tx.mut_repo().rebase_descendants(&self.settings)?;
self.user_repo = ReadonlyUserRepo::new(tx.commit());
locked_working_copy.finish(op_id)?;
locked_working_copy.finish(self.user_repo.repo.op_id().clone())?;
}
_ => {
let num_rebased = tx.mut_repo().rebase_descendants(&self.settings)?;