From aa3dfaa8598e36ed280ceafbcb83f0364596fb54 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 19 Sep 2023 20:19:44 +0900 Subject: [PATCH] cli: fix operation id recorded on unmanaged Git HEAD move This appears to be broken at db0d14569b86 "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. --- cli/src/cli_util.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 68dfd2eef6..2371853f89 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -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)?;