mirror of
https://github.com/jj-vcs/jj.git
synced 2025-12-23 06:01:01 +00:00
cli: on finish_transaction(), record operation id even if working copy is clean
While debugging stale working-copy recovery, I noticed the checkout commit resurrected from the ancestor_op was way beyond the ancestor commit made by jj squash. This patch is a workaround for the problem. I'm not pretty sure if updating operation id is the right thing. If not, maybe we'll need to look up more recent operation corresponding to the wc tree id from the <ancestor_op>: range?
This commit is contained in:
parent
c7a782b0a1
commit
443e73f346
1 changed files with 4 additions and 0 deletions
|
|
@ -1004,6 +1004,10 @@ fn update_working_copy(
|
|||
})?;
|
||||
Some(stats)
|
||||
} else {
|
||||
// Record new operation id which represents the latest working-copy state
|
||||
// TODO: no need to rewrite the tree_state file
|
||||
let locked_wc = wc.start_mutation();
|
||||
locked_wc.finish(repo.op_id().clone());
|
||||
None
|
||||
};
|
||||
if Some(&new_commit) != old_commit {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue