mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-17 17:55:29 +00:00
working_copy: write tree_state file on init
I don't think there's a good reason not to write the `.jj/working_copy/tree_state` file on init. Being able to assume that the file exists means that we won't need the store object to to lazily load the `TreeState` object. Well, except that `TreeState` keeps an `Arc<Store>`, but I'm trying to change that.
This commit is contained in:
parent
3d965f22ab
commit
5fecb396aa
1 changed files with 3 additions and 1 deletions
|
@ -1035,12 +1035,14 @@ impl WorkingCopy {
|
|||
.open(state_path.join("checkout"))
|
||||
.unwrap();
|
||||
file.write_all(&proto.encode_to_vec()).unwrap();
|
||||
let tree_state =
|
||||
TreeState::init(store.clone(), working_copy_path.clone(), state_path.clone());
|
||||
WorkingCopy {
|
||||
store,
|
||||
working_copy_path,
|
||||
state_path,
|
||||
checkout_state: OnceCell::new(),
|
||||
tree_state: OnceCell::new(),
|
||||
tree_state: OnceCell::with_value(tree_state),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue