Skip to content

Commit

Permalink
cli: fix operation id recorded on unmanaged Git HEAD move
Browse files Browse the repository at this point in the history
This appears to be broken at db0d145 "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.
  • Loading branch information
yuja committed Sep 19, 2023
1 parent 742df27 commit 7d8031e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)?;
Expand Down

0 comments on commit 7d8031e

Please sign in to comment.